Skip to content

Use monotonic time for conditional wait deadlines - #5656

Open
fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/conditional-wait-monotonic-5653
Open

fallintoplace wants to merge 1 commit into
NVIDIA:mainfrom
fallintoplace:fix/conditional-wait-monotonic-5653

Conversation

@fallintoplace

Copy link
Copy Markdown
Contributor

Fixes #5653.

Description

What: Keep conditional waits stable when the system clock changes.

Why: Wall-clock adjustments can make a finite FL wait time out early or run too long.

Implementation: Measure the timeout using time.monotonic(). Add deterministic tests for backward and forward clock steps.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Quick tests passed locally by running ./runtest.sh.
  • In-line docstrings updated.
  • Documentation updated.

Testing

  • Isolated behavioral reproductions passed (4 checks across the three fixes).
  • Full repository ./runtest.sh -s and pytest were unavailable without a checkout and style dependencies. Added focused regression tests for CI.

Risk

Low. Only the clock used for elapsed timeout calculation changes; event, abort and callback ordering stays unchanged.

Signed-off-by: Minh Vu <vuhoangminh97@gmail.com>
@greptile-apps

greptile-apps Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[High impact] This PR appears safe to merge.

Summary

Changes conditional_wait to measure elapsed time with time.monotonic(), so wall-clock changes cannot shorten or extend finite waits.

  • Finite waits keep their deadlines steady when the system clock changes.

Reviews (1) · Last reviewed commit: "Use monotonic time for conditional wait ..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use a monotonic clock for conditional_wait deadlines

1 participant