Fix timeout error message and use time.monotonic() in openai batch trigger#69759
Open
magic-peach wants to merge 1 commit into
Open
Fix timeout error message and use time.monotonic() in openai batch trigger#69759magic-peach wants to merge 1 commit into
magic-peach wants to merge 1 commit into
Conversation
The timeout error message computed time.time() - self.end_time which produces a negative number since end_time is already in the past. Replace with a clear message stating the batch did not complete within the configured timeout. Also switch to time.monotonic() for the timeout check to align with the project coding standard. Signed-off-by: Akanksha Trehun <akankshatrehun@gmail.com>
SameerMesiah97
left a comment
Contributor
There was a problem hiding this comment.
CI is failing for this one as well. My comment on PR #69758 broadly applies here too. In particular, I don't think time.time() should be replaced with time.monotonic() for the serialized trigger deadline, as this appears to introduce the same class of issue we previously fixed in #67616.
I also don't think the timeout error message change is an improvement, as it removes useful context (the configured timeout duration) that's helpful when debugging.
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.
Fix a logic bug in the OpenAI batch trigger timeout error message. The previous code computed
time.time() - self.end_timewhich produces a negative number sinceend_timeis already in the past when the timeout fires. Replace with a clear message stating the batch did not complete within the configured timeout.Also switch to
time.monotonic()for the timeout check to align with the project coding standard (AGENTS.md: "time.monotonic()for durations, nottime.time()").Changes:
openai/triggers/openai.py: Fix timeout error message and usetime.monotonic()openai/operators/openai.py: Usetime.monotonic()when setting the trigger end_timeWas generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Opus 4.7) following the guidelines
Drafted-by: Claude Code (Opus 4.7) (no human review before posting)