-
Notifications
You must be signed in to change notification settings - Fork 551
Hang on sync_commit() #32
Comments
Unfortunately, the issue has yet to be reproduced with logging enabled (but is fairly consistently reproduced without logging enabled). As a result it's tough to see if there's anything different about the calls when the hang occurs. |
Hi, Thanks for reporting it! Best |
I’ve actually fixed it! Just writing up a report. Be here shortly.
… On Jan 15, 2017, at 4:26 PM, Simon Ninon ***@***.***> wrote:
Hi,
Thanks for reporting it!
I think I already saw that issue a few time ago but do not remember exactly what was the issue.
From my memories, that was due to callback handling from network part, so it should be fixed when I'll integrate the new network part I'm working on (I nearly finished it, just coding the windows port).
Best
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#32 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABMXFB3Iz4Y0AGUch7RN3eaiJYL67YNzks5rSo77gaJpZM4LjxUi>.
|
wow, really cool to hear that! Thanks a lot :) |
Phew. It's a race condition. I'm able to reproduce it consistently with the following changes (assuming a short callback time from a Redis request). Take note of the added thread sleeps (this is what makes it easy to reproduce). Change
Change
The root problem is that 0ms: application thread calls |
The problem should be fixed by acquiring the mutex in |
Indeed, really good catch! The mutex lock can be a quick way to fix it for now. Then I plan to reorganize a bit the code to reduce the number of locks in order to improve performance in the next weeks (first need to finish the new network part). Thanks for your work, greatly appreciate it! |
…ut mutex protection Fixes Cylix#32
…ut mutex protection Fixes Cylix#32
We have a sync_commit call that works fine most of the time, but on occasion it seems to hang on the following line:
m_sync_condvar.wait(lock_callback, [=] { return m_callbacks_running == 0 && m_callbacks.empty(); });
m_callbacks_running
is 0 andm_callbacks
is empty, but it looks like the condition variable is not being notified? It just waits forever and nothing makes progress. I'm not really sure how to debug this!The text was updated successfully, but these errors were encountered: