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?
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?
is working on a reply...