refactor(timers): unify the duplicated ClockConditionalVariable implementations #3401
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.40) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 316 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #3401"
general
weight: 0.35
skyegalaxy
Description
<!--
Please include a summary of the changes and the related issue.
Highlight any key points or areas of concern.
-->
The timer manager in #3097 introduced a variant of
ClockWaiterandClockConditionalVariablewhich could accept a clock on itswait_untilcalls instead of at construction. This PR unifies bothClockWaiterandClockConditionalVariableunder one set which can do both, and removes the duplicates intimer_manager.ClockWaiterandClockConditionalVariablecan now accept a null clock at construction, and both gain await_until(lock, clock, until, pred)overload. The existing overloads without a clock are unchanged.ClockConditionalVariablekeeps oneClockWaiterfor its whole lifetime, sonotify_one()takes no lock and a wait performs no allocation.TimerQueueusesrclcpp::ClockConditionalVariabledirectly, now constructed with a null clock.std::runtime_error. Before, waiting without a clock dereferenced a null pointer.<!--
Automatically closes linked issue when PR is merged.
Usage:
Fixes #<issue number>, orFixes (paste link of issue).-->
Is this user-facing behavior change?
<!--
If no, just leave this section empty.
If yes, please explain how user-experience changes with this pull request.
-->
rclcpp::ClockConditionalVariable::wait_until()used to returntrueunconditionally. It now returnsfalseif the context was shut down before the call. Callers that ignored the return value need no change.A wait whose
untildoesn't match the clock's type now throws before it starts, on every clock type.Did you use Generative AI?
<!--
If this pull request was generated using Generative AI, please specify the tool and model used (e.g., GitHub Copilot, GPT-4.1).
If only specific parts were generated by Generative AI, please list those parts (e.g., function A, class B, etc.).
-->
Yes, Claude Opus 5.5
Additional Information
<!--
If applicable, provide any additional context or details about the changes.
-->