Bound individual condition waits for very large timeouts - #120
Open
OskarEichler wants to merge 1 commit into
Open
Bound individual condition waits for very large timeouts#120OskarEichler wants to merge 1 commit into
OskarEichler wants to merge 1 commit into
Conversation
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.
Summary
Cap each internal condition-variable wait at one day while retaining the original monotonic deadline. Large positive/infinite timeouts otherwise raise RangeError inside the shared watcher and discard its active request set.
Reproduction
Run this standalone reproduction in a disposable process; it inspects/stops that process's private watcher. No external services are used.
Focused checks cover Float::INFINITY, 1e100, a large Integer and Rational, and a finite interval exceeding one day. After each long request starts, a short request still wakes the watcher and times out; the long operation can finish normally. This verifies signaling, not a literal 24-hour elapsed-time run.
Verification
295667aac44220ddfd10db014e766ae8d313cfb8.bundle exec rake test: 36 tests / 81 assertions / zero failures or errors, baseline and this branch. Includes the existing signal, fork, Ractor, exception and mocked-scheduler cases.git diff --checkpass. Supplemental RuboCop Lint retains the same two existing offenses; no lint-clean claim.Compatibility and limitations
No timeout value or deadline is shortened. Very long operations may cause a periodic internal wakeup, at most once per day when otherwise idle. Existing queue signals still wake the watcher for shorter deadlines. The one-day wait is deliberately far below platform time-conversion limits. Ruby 4.0.6/macOS was run; other platforms require CI. NaN rejection is handled separately.
The same runtime file is shipped in 0.6.1; this patch can be adopted without a release upgrade. Ruby >= 2.6 and the empty runtime dependency set remain unchanged. No production access or external network diagnostic was used; other Ruby/OS combinations and full scheduler implementations were not run locally.