Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4331 +/- ##
=======================================
Coverage 86.69% 86.69%
=======================================
Files 527 527
Lines 20902 20902
=======================================
Hits 18119 18119
Misses 2783 2783
🚀 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
a8589d6 to
f71ea10
Compare
|
Correcting three figures I put on this pull request on 3 August, because they have drifted and the drift makes this change look larger than it is. That comment said this one carries 23 lines of production code, #4297 211 and #4337 181. Measured again on the current heads: this one changes So the production change here is two calls. A reviewer who would sooner spot check than read the whole thing has one question: do those two states really end a session with nothing further coming? If they do, the waiter is never released, because The test file is the rest of the diff, 265 lines to 590, and I would rather say why than leave it looking like padding. It adds a fake client that can deliver a terminal state after the handoff, which the existing fakes cannot, and eleven cases on top of the six already there. They cover each terminal state, and the orderings where a response and an I/O error arrive in either sequence, and a session destroyed while a request is still pending. If eleven is more than this change is worth, say so and I will cut it to Two things that are not about the code. The failing check is the runner's security agent rather than the build: the failed step carries no compile or test output, only a 401 from the agent's own detection-rules API and a 500 from its upload step, and the same conan job is green on my other open pull requests. Rerunning it needs repository admin, so it will clear the next time And on #4502, @om7057 found that a comment of mine there named the wrong mechanism. |
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>
9ba813f to
e4c72a8
Compare
The 1.30.0 release rewrote the Unreleased section, which is the whole conflict. Both sides kept, ours after main's. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
The 1.30.0 release rewrote that section, and resolving the conflict in place left this entry inside the released block, where it reads as shipped. Rebuilt as main's file with this branch's entry inserted under Unreleased, so the only difference from main is the entry itself. Signed-off-by: thc1006 <84045975+thc1006@users.noreply.github.com>
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.