Repository navigation
Wait for the queue when close() is given an unbounded timeout - #19
Merged
Merged
Conversation
close() turned timeoutSeconds * 1000 into a long long. For infinity, NaN or a value past long long's range that conversion is undefined, and on x86-64 close(INFINITY) gave up at once: the queue was cleared and the curl in flight killed. A bound that fit in milliseconds could still overflow the clock's nanoseconds (1e12 s). NaN and negative bounds now wait for nothing, and a bound past about three years waits on the condition with no deadline until the sending thread is done. Each request is still bounded by curl's timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (head
Repo-specific:
Notes:
This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
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
TraceClient::close(timeoutSeconds)no longer converts an out-of-range double tolong long, which is undefined behaviour. Before this change,close(INFINITY),close(DBL_MAX)andclose(1e300)were observed to give up at once on x86-64/g++, so every queued report was dropped (see close() with an infinite or very large timeout drops every queued report #18).close()doc comment and the README "close()drains" row now describe these bounds.Test plan
make test(g++, C++11):57 tests, 0 failed checks(55 before, plus 2 new tests, both registered intests[])closeWithABoundTooLongForTheClockSendsEverythingQueuedfailed (expected [5] got [0]for infinity,DBL_MAXand1e300). After the fix it passes.closeWithANegativeOrNanBoundWaitsForNothingchecks that NaN,-1and-INFINITYstill return within 1 s while the server is held.Skipped issue
TRACE_CLIENT_CURLignored on Windows whenSystem32\curl.exeexists) was not picked. It explicitly asks the owner to choose between honoring the override and documenting the current behaviour, and the change would touch thecurl.exelookup, which is part of the documented security boundary.Closes #18
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson