Retry when poll_read_ready immediately succeeds in AsyncChannel#592
Merged
Conversation
BenchmarksComparisonBenchmark execution time: 2024-08-22 16:40:57 Comparing candidate commit 82edf70 in PR branch Found 3 performance improvements and 0 performance regressions! Performance is the same for 47 metrics, 2 unstable metrics. scenario:normalization/normalize_service/normalize_service/[empty string]
scenario:normalization/normalize_trace/test_trace
CandidateCandidate benchmark detailsGroup 1
Group 2
Group 3
Group 4
Group 5
Group 6
Group 7
Group 8
Group 9
Group 10
Group 11
BaselineOmitted due to size. |
d00b971 to
d971b77
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #592 +/- ##
==========================================
- Coverage 72.90% 72.84% -0.07%
==========================================
Files 241 241
Lines 34364 34366 +2
==========================================
- Hits 25054 25034 -20
- Misses 9310 9332 +22
|
iamluc
approved these changes
Aug 22, 2024
bantonsson
approved these changes
Aug 22, 2024
UnixStream::poll_read_ready may return Poll::Ready(Ok(())), which incidentally, when returned by an AsyncRead::poll_read function without further modification of buf, means that the channel was closed. The intended meaning is "immediately available", and thus we need to re-read. This only can happen when epoll() is resumed between a recvmsg() call and the poll_ready_ready function being invoked, which may only happen in a multithreaded environment, which we recently switched to. Signed-off-by: Bob Weinand <bob.weinand@datadoghq.com>
d971b77 to
fab9a1b
Compare
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.
UnixStream::poll_read_ready may return Poll::Ready(Ok(())), which incidentally, when returned by an AsyncRead::poll_read function without further modification of buf, means that the channel was closed. The intended meaning is "immediately available", and thus we need to re-read.
This only can happen when epoll() is resumed between a recvmsg() call and the poll_ready_ready function being invoked, which may only happen in a multithreaded environment, which we recently switched to.
This PR reminded me why race conditions are so much fun.