-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AMQ-9448 Fix persistent scheduler deadlock #1177
base: main
Are you sure you want to change the base?
Conversation
Please use existing org.apache.activemq.broker.scheduler.JmsSchedulerTest#testCron test to confirm that persistent scheduler currently deadlocks on CRON jobs. This is not the same deadlock as reported in AMQ-9448, but it is caused by the same reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be great to add a unit test to illustrate how deadlock can happen and this change actually fix it.
Do not fire or schedule jobs while holding read lock on store.
bd33b42
to
0448cf2
Compare
I have now added a new unit test. Does existing JmsSchedulerTest#testCron unit test run successfully for you before this change? |
Do you have a thread dump of the deadlock occurring? |
Yes. This is the stack trace of "JobScheduler:JMS" thread blocked by itself due to acquiring read lock on store while iterating scheduled jobs in mainLoop() method and then attempting to acquire write lock to write a new scheduled job information: Full dump: |
Do not fire or schedule jobs while holding read lock on store.