Preserve the deadline in IceGrid ServerEntry synchronization waits - #6641
Open
bernardnormier wants to merge 1 commit into
Open
Preserve the deadline in IceGrid ServerEntry synchronization waits#6641bernardnormier wants to merge 1 commit into
bernardnormier wants to merge 1 commit into
Conversation
ServerEntry shares the Allocatable mutex and condition variable, so the condition variable is also notified by allocation state transitions. waitImpl restarted a full wait_for(timeout) on every wake-up, so such notifications during a pending synchronization could extend the wait well past the requested timeout. Wait on an absolute deadline with a predicate instead. Addresses part of item 2 of zeroc-ice#6626. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
bernardnormier
requested review from
InsertCreativityHere and
externl
and
a balanced review from Copilot
August 17, 2026 20:50
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes IceGrid synchronization waits so allocation notifications cannot extend their timeout.
Changes:
- Uses a steady-clock deadline with a predicate.
- Preserves zero and negative timeout semantics.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| _condVar.wait(lock); | ||
| } | ||
| } | ||
| _condVar.wait_until(lock, chrono::steady_clock::now() + timeout, [this] { return !_synchronizing; }); |
Comment on lines
+710
to
+712
| 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; }); |
This was referenced Aug 17, 2026
InsertCreativityHere
approved these changes
Aug 17, 2026
InsertCreativityHere
left a comment
Member
There was a problem hiding this comment.
Looks good to me.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ServerEntryshares theAllocatablemutex and condition variable, so the condition variable is also notified by ordinary allocation state transitions.ServerEntry::waitImplrestarted a fullwait_for(timeout)on every wake-up, so such notifications during a pending synchronization could extend the wait well past the requested timeout, delaying theSynchronizationException. It now waits on an absolute deadline with a predicate, so unrelated notifications can't extend the bound.Addresses the deadline part of item 2 of #6626. The other part of item 2 (remote Glacier2 session-filter invocations while holding the shared mutex) is an instance of a broader pattern to address in 3.9.
🤖 Generated with Claude Code