-
Notifications
You must be signed in to change notification settings - Fork 601
Preserve the deadline in IceGrid ServerEntry synchronization waits #6641
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -707,22 +707,13 @@ void | |
| ServerEntry::waitImpl(chrono::seconds timeout) | ||
| { | ||
| unique_lock lock(_mutex); | ||
| if (timeout != 0s) | ||
| if (timeout > 0s) | ||
| { | ||
| while (_synchronizing) | ||
| { | ||
| if (timeout > 0s) | ||
| { | ||
| if (_condVar.wait_for(lock, timeout) == cv_status::timeout) | ||
| { | ||
| break; // Timeout | ||
| } | ||
| } | ||
| else | ||
| { | ||
| _condVar.wait(lock); | ||
| } | ||
| } | ||
| _condVar.wait_until(lock, chrono::steady_clock::now() + timeout, [this] { return !_synchronizing; }); | ||
|
Comment on lines
+710
to
+712
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Asserting that the exception lands at the original deadline means a wall-clock timing assertion while generating cross-thread notification churn — that's a flaky test, not a regression guard. The change is the standard deadline-with-predicate idiom; the existing allocation suite covers the functional behavior. |
||
| } | ||
| else if (timeout < 0s) | ||
| { | ||
| _condVar.wait(lock, [this] { return !_synchronizing; }); | ||
| } | ||
| if (_synchronizing) // If we are still synchronizing, throw SynchronizationException | ||
|
Comment on lines
717
to
718
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reaching this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couldn't we still hit this when
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're right I didn't read this very well. |
||
| { | ||
|
|
||
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.
The symptom is a late
SynchronizationException, and only under sustained allocation churn on the same entry — notifications must keep arriving faster than the timeout to extend the wait. Nothing user-visible changes during normal operations, so no changelog entry.