Failed to clean up old reports Transaction Error
-
We are getting the following error in our prod env after upgrading to jsreport 4.4.
Failed to clean up old reports Transaction (Process ID 2) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction. code=EREQUEST, originalError=Error: Transaction (Process ID 2) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction., name=RequestError, number=1205, lineNumber=1, state=45, class=13, serverName=***, procName=, precedingErrors=, stack=RequestError: Transaction (Process ID 2) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
We have multiple instances of jsreport running on ubuntu in docker containers, we use mssql as our store and blobStorage is aws s3 buckets.
Error started 30days after we upgraded to 4.4 i'm assuming cause our cleaning threshold is 30d
Clean up configuration:
"cleanInterval": "3h",
"cleanThreshold": "30d",
"cleanParallelLimit": 10Also we don't see the error in our labs env but there are a lot less reports generated there than in our prod env.
Any idea why we might be getting this when the reports cleanup happens? Could lowering the ParallelLimit help?
-
That is a bit strange, because the cleanup logic doesn't use transactions. I am not sure where the lock comes from.
Anyway, this is just a warning which shouldn't affect your system. It will try to remove again after the
cleanInterval
.
I would recommend lowering thecleanInterval
so the process runs more often and don't need to clean many reports at once. Even every few minutes should be good interval.
-
OK thanks we will change that and see if it helps.