core/filed: fix spurious wakeups race condition in filed.#2508
core/filed: fix spurious wakeups race condition in filed.#2508BareosBot merged 2 commits intobareos:masterfrom
Conversation
|
Looks like a pretty good catch. Thank you very much for contributing this! |
|
@sebsura this looks totally reasonable. Anyway, would you mind taking another look at it? |
|
You're welcome! I actually encountered it multiple times before starting to investigate... |
|
Awesome find @thvorr . As mentioned in the comment above, I would rather use a |
|
@thvorr Feel free to add yourself to the AUTHORS file. |
|
@sebsura: I’m happy to be listed as an author if I contribute a significant part. Not for now, thanks :) |
a1d9a3a to
d2268ad
Compare
sebsura
left a comment
There was a problem hiding this comment.
Thanks for the great work!
23b6b99 to
2fcf4c2
Compare
This patch fixes a race condition in filed due to spurious wakeups. Without this fix, a thread waiting on the compute_fin condition variable may wake up spuriously immediately after the lock counter is decremented but before notify_one() is called. In that window, the thread can bail out prematurely, which later leads to a segmentation fault when the other thread calls notify_one().
34060d2 to
e6c3784
Compare
This patch fixes a race condition in filed due to spurious wakeups.
Without this fix, a thread waiting on the compute_fin condition variable may wake up spuriously immediately after the lock counter is decremented but before notify_one() is called. In that window, the thread can bail out prematurely, which later leads to a segmentation fault when the other thread calls notify_one().
Thank you for contributing to the Bareos Project!
Please check
Your name is present in the AUTHORS file (optional)If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality