Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4331 +/- ##
=======================================
Coverage 86.53% 86.53%
=======================================
Files 525 525
Lines 20482 20482
=======================================
Hits 17722 17722
Misses 2760 2760
🚀 New features to boost your workflow:
|
69473bc to
26ea36f
Compare
The helper tests call IsBulkResponseSuccessful() directly, so they cannot show that the status and the body reach it. A handler that stored a fixed status, or an Export() that never asked for one, passes all of them. Three cases through the exporter with a fake HTTP client: an accepted bulk response, the rejected item from open-telemetry#4295 whose shard counter still reads "failed" : 0, and a 500 carrying a body the parser would otherwise accept. The fake client is the same one open-telemetry#4331 adds to this file. Whichever lands first, the other drops the duplicate when it rebases.
The helper tests call IsBulkResponseSuccessful() directly, so they cannot show that the status and the body reach it. A handler that stored a fixed status, or an Export() that never asked for one, passes all of them. Three cases through the exporter with a fake HTTP client: an accepted bulk response, the rejected item from open-telemetry#4295 whose shard counter still reads "failed" : 0, and a 500 carrying a body the parser would otherwise accept. The fake client is the same one open-telemetry#4331 adds to this file. Whichever lands first, the other drops the duplicate when it rebases.
26ea36f to
4dcfc60
Compare
The helper tests call IsBulkResponseSuccessful() directly, so they cannot show that the status and the body reach it. A handler that stored a fixed status, or an Export() that never asked for one, passes all of them. Three cases through the exporter with a fake HTTP client: an accepted bulk response, the rejected item from open-telemetry#4295 whose shard counter still reads "failed" : 0, and a 500 carrying a body the parser would otherwise accept. The fake client is the same one open-telemetry#4331 adds to this file. Whichever lands first, the other drops the duplicate when it rebases.
c5e8c69 to
a8bcd0b
Compare
2073625 to
206c68f
Compare
Reported by include-what-you-use on open-telemetry#4331, which has the same construct. Adding it here rather than waiting for the same red run.
Reported by include-what-you-use on open-telemetry#4331, which has the same construct. Adding it here rather than waiting for the same red run.
Reported by include-what-you-use on open-telemetry#4331, which has the same construct. Adding it here rather than waiting for the same red run.
|
Context that saves working it out, since this one, #4297 and #4337 all sit on Any two of the three conflict there, so whichever lands first the other two need a rebase. I will do those rebases, and there is no reason to take more than one of them. Measured sizes, if it helps to pick a starting point. This one is 23 lines of production code and ends a wait that otherwise never returns. #4297 is 211 lines and stops a batch Elasticsearch rejected from reading as written. #4337 is 181 lines and the largest of the three. The test files are bigger than the production diffs in all three because each carries its own fake HTTP client; the second and third to land drop that copy when they rebase. They fix separate things and none of them depends on the others, so the order is whatever suits you. |
acc15e1 to
85ec7ba
Compare
d8826b4 to
9cf9661
Compare
090a25d to
f1ec07c
Compare
Two CHANGELOG bullets pointed at this PR and said the same thing twice. The first names what the exporter now decides success from, so the second goes. The fixture comment described how this file and open-telemetry#4331 would be reconciled. That is coordination between PRs, not something a reader of this file needs. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
5820fbf to
d068395
Compare
Two CHANGELOG bullets pointed at this PR and said the same thing twice. The first names what the exporter now decides success from, so the second goes. The fixture comment described how this file and open-telemetry#4331 would be reconciled. That is coordination between PRs, not something a reader of this file needs. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
d068395 to
755d681
Compare
755d681 to
a8589d6
Compare
ResponseHandler::OnEvent records a completion for each session state that ends the session, but ReadError and WriteError only log. A client that reports either of them as its last event leaves the synchronous Export() blocked on its condition variable with nothing left to wake it. The bundled curl client dispatches neither state, so this does not change behaviour for callers who use it. It matters for the HttpClient that the exporter's constructor accepts. The cases live in the existing synchronous fixture, which skips when the exporter is built for async export, and a CTest timeout bounds them because a regression here stalls the job rather than failing an assertion. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
a8589d6 to
f71ea10
Compare
Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com> # Conflicts: # CHANGELOG.md
Fixes #4330.
ResponseHandler::OnEventrecords a completion for each session state that ends the session.ReadErrorandWriteErroronly log, so a client that reports either of them as its last event leaves the synchronousExport()waiting on its condition variable with nothing left to wake it. Two lines make those two behave like the other terminal states.What this does not change, and one question for you
The bundled curl client dispatches nine session states and neither of these is among them, so this changes nothing for callers who use it. It matters for the
HttpClientthat the exporter's constructor accepts.Worth putting in front of you rather than burying:
otlp_http_client.cchandlesReadErrorandWriteErrorexactly the way the Elasticsearch exporter does today, logging at debug and carrying on. After this change the two exporters treat them differently. TheSessionStatecomments say only "error reading response" and "error writing request", so there is no stated contract either way. If you would rather the two exporters stayed consistent, the alternative is to leave this alone and bound the wait instead, and I am happy to close this and open that one.Evidence
Removing just the two
recordCompletion()calls and rebuilding:ReadErrorEndsTheWaitWriteErrorEndsTheWaitAReadErrorAfterTheHandoffEndsTheExportIoErrorBeforeAResponseKeepsTheFailurekSuccesswherekFailureis expectedProgressStatesDoNotDecideTheResult, bothSessionDestroyedcasesWith the fix, the synchronous build runs 14 tests green and the async build skips the 11 that need the synchronous wait. The CTest timeout is there because a regression in this area stalls the job instead of failing an assertion.
What moved out
This pull request previously also made every terminal log line conditional on winning the completion race, and added an error line when a session is destroyed before a response arrives. That half needs a log-capturing fixture, it is a separate behaviour, and it is the reason the diff was four times this size. It is out, and I will open it separately once this one is settled. What is left is the two lines the title describes.
Verified locally: CMake in both the synchronous and async configurations with maintainer mode, Bazel, clang-format, cmake-format against the repository config, and markdownlint 0.46.0.