|
[
Permlink
| « Hide
]
Torsten Mielke added a comment - 22/Oct/09 12:43 PM
Perhaps a fix could limit the amount of time the cleanup task gets to executed to ensure it doesn't block everything else.
This problem does not seem to manifest on every JDBC database. I reproduced it using MySQL. However when Apache Derby is used, the problem is not observed. It seems that Derby does not lock the entire db table when running the cleanup task's SQL statement (perhaps a row locking mechanism is applied).
So whatever solution is worked out for this bug, it should probably be configurable. the cleanup task is using a fixed rate rather than a fixed delay executor so changing that would make it a lot better. At least if it takes 20minutes, it will wait cleanupInterval before trying again. At the moment a bunch of cleanup executions will have backed up and it will execute immediately again.
That may do it. Another approach would be to limit the number of rows that are queried by the delete statement, but some state needs to be maintained to allow the entire table to be processed over time. ROWNUM > X < Y opened https://issues.apache.org/activemq/browse/AMQ-2470
If this is not sufficient, a limit via ROWNUM needs to be explored. merged fix from https://issues.apache.org/activemq/browse/AMQ-2470
cleanup period attribute on the JDBCPeristenceAdapter allows the period to be configured. This period is now the delay from the finish of the task till the next start such that it won't hog the DB. |
||||||||||||||||||||||||||||||||||||||||||||