Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • qubaji 1 post 21 karma points
    Jul 25, 2023 @ 14:52
    qubaji
    0

    ContentVersionCleanup causes other RecurringHostedService to fail with SQL lock timeout error

    I have my own RecurringHostedService which runs at the same(ish) time each day. I have achieved this by setting the delay dynamically.

    Unfortunately on a couple of occasions this has failed partway through, and the error in the logs is:

    Lock request time out period exceeded

    The service stops at this point and of course does not run again until the next day.

    This doesn't happen every day, just very occasionally. But this is a product import task, which means the catalogue is not updated until the following day (unless I catch it and trigger a manual import), which isn't ideal.

    The last time this happened, around 30 seconds later in the logs I can see the ContentVersionCleanup has run and cleaned up 1000+ versions. I'm wondering if the two are connected. Could it be that ContentVersionCleanup is locking up the database such that other calls to write content fail?

    For now I have added a minimum delay of 10 minutes after startup to try to stop the two clashing (CVC has a 3 minute delay), but I'm wondering if there's a more robust way of dealing with this?

Please Sign in or register to post replies

Write your reply to:

Draft