Repository navigation
Treat an early transport timeout at the review deadline as TIMED_OUT (fixes #89) - #173
Open
rushmithanadipally wants to merge 1 commit into
Open
rushmithanadipally wants to merge 1 commit into
rushmithanadipally wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Problem
wait_for_review(timeout=T) promises TIMED_OUT when time runs out. Each read is limited to the time left. If the server is silent, the read ends with the SDK timeout error. wait_for_review only turned that into TIMED_OUT when remaining() was <= 0. On Windows a socket wait can end a fraction of a millisecond early, so remaining() is still a tiny positive number and the timeout is raised as ProoflineError(0, "urn:proofline:sdk:timeout") instead (issue #89, reproduced there with 0.05 to 0.6 ms left).
Approach
Add _transport.deadline_reached(), which treats the budget as spent when 5 ms or less is left (DEADLINE_SLACK). Use it in the status-0 check in both ProoflineClient.wait_for_review and AsyncProoflineClient.wait_for_review. A timeout with real budget left still raises.
Verification