-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Seeing DeadLock when the join() on the Deferred times-out at approximately same time as runcallbacks and doCall for Signal callback #4
Comments
Sigh, What do you think about this fix: tsuna/async@d5e34d9 – can you confirm that fixes the problem for you? |
Please confirm that the problem is now resolved and I'll push a new version to Maven. |
Will run in prod and confirm tomorrow, Also thanks for the quick fix |
Looks like this resolved the problem, did not see any issues until now. Again thanks for the quick turn around |
Can confirm no issues in high traffic also, this resolved the problem |
I pushed v1.4.1 to Maven. Thanks for the bug report with the excellent analysis. |
Hi,
We are seeing frequent deadlocks happening because the Deferred tries to acquire lock (code-link) due to synchronize(this) when it tries to run the callback chain and Signal (the callback object inside Deferred) also needs to acquire lock (code-link) on itself when it tries to run its callback method to notify the waiter. But inside doJoin method the lock is already acquired on the Signal (code-link)and when you are trying to throw the TimeOutException it will try to convert the Deferred to String which leads to acquiring the lock(code-link) on (this) Deferred. Hope you follow the logic I am also attaching the jstack output so it can make more sense.
I am thinking of a couple of ways to fix this, I want your suggestions
synchronized (signal_cb) {
(line no : 1133 Deferred.java). This may require to set a bool that timeout happen and come out of synchronize to check status and then throw exception if it is still pending or something like that.The text was updated successfully, but these errors were encountered: