Skip to content

Reject non-positive intervals before scheduling can hang - #658

Open
oyeong011 wants to merge 1 commit into
dbader:masterfrom
oyeong011:fix/reject-non-positive-intervals
Open

oyeong011 wants to merge 1 commit into
dbader:masterfrom
oyeong011:fix/reject-non-positive-intervals

Conversation

@oyeong011

Copy link
Copy Markdown

every(0).seconds.do(...) and every(-1).seconds.do(...) never return: the next-run loop repeatedly adds a period that cannot advance past the current time.

Reject non-positive intervals in Job.__init__ with ScheduleValueError, before a job can reach registration. This covers both every() and direct Job construction.

Validation on Python 3.12:

  • Both original registration commands timed out in separate processes; both now reject the input promptly.
  • Four regression subtests fail before the fix and pass afterward.
  • Full suite with pytz: 83 passed, 4 subtests passed.
  • Without pytz: 42 passed, 41 skipped, 4 subtests passed.
  • Mypy and pinned Black 20.8b1 checks pass.
  • A positive-interval job executes once through Scheduler.run_pending() and is rescheduled.

The supported Python/OS matrix was not run locally. This validation occurs during every()/Job construction.

AI disclosure: This change and its tests were prepared with OpenAI Codex assistance under my direction.

Validate positive intervals before registration can enter an unbounded next-run loop.

Confidence: high
Scope-risk: narrow
Tested: 83 tests and 4 subtests, no-pytz suite, public scheduler QA, mypy, Black
Not-tested: Full supported Python and OS matrix
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-08T01:21:10.764569Z 2a7daa7 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

1 participant