Skip to content

fix: preserve explicit zero polling durations - #205

Open
yigitcan-ozturk wants to merge 2 commits into
xai-org:mainfrom
yigitcan-ozturk:fix/poll-timer-zero-duration
Open

yigitcan-ozturk wants to merge 2 commits into
xai-org:mainfrom
yigitcan-ozturk:fix/poll-timer-zero-duration

Conversation

@yigitcan-ozturk

Copy link
Copy Markdown

Checklist

  • I have read both the CONTRIBUTING.md and Contributor License Agreement documents.
  • I have created an issue or feature request and received approval from xAI maintainers. (minor changes like fixing typos can skip this step)
  • I have tested my changes locally and they pass all CI checks.
  • No documentation changes are required for this internal bug fix.

Description

PollTimer currently uses truthiness to apply defaults:

self._timeout = timeout or datetime.timedelta(minutes=10)
self._interval = interval or datetime.timedelta(seconds=1)

@yigitcan-ozturk

Copy link
Copy Markdown
Author

Hi maintainers — just following up on this PR since it has been open for a little while. The change is intentionally small and remains scoped to preserving explicitly supplied zero polling durations, with regression coverage included. Please let me know if there is anything you'd like adjusted or any additional validation needed to move this forward. Thanks!

@deanrie

deanrie commented Oct 23, 2026

Copy link
Copy Markdown

Hey @yigitcan-ozturk, a sequencing note: #224 rewrites poll_timer.py to measure elapsed time on the monotonic clock (#204 inside it), and git merge-tree shows this PR conflicting with it on the two assignment lines. The change itself is right, timeout or default treats timedelta(0) as missing and is not None does not, so once #224 lands this becomes a two-line rebase plus your test file; if you would rather land first, #224 takes the conflict instead. Either order keeps both fixes.

@yigitcan-ozturk

Copy link
Copy Markdown
Author

Thanks @deanrie for checking the merge-tree conflict and confirming the fix.

Since #205 is a small, self-contained correctness fix with regression coverage, my preference would be to land it first if the maintainers agree.

That said, I'm happy to accommodate either merge order. If #224 lands first, I'll rebase #205 onto the updated main, preserve the explicit None checks in the monotonic-clock implementation, and keep the regression tests.

Thanks for coordinating!

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.

2 participants