Skip to content

[EXPORTER] Fix incorrect doc comment about SessionState::TimedOut in the Elasticsearch exporter - #4647

Open
om7057 wants to merge 2 commits into
open-telemetry:mainfrom
om7057:fix/remove-dead-timedout-session-state
Open

om7057 wants to merge 2 commits into
open-telemetry:mainfrom
om7057:fix/remove-dead-timedout-session-state

Conversation

@om7057

@om7057 om7057 commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #4604 (doc comment only; the enum question needs SIG discussion, see below)

Changes

ResponseHandler::waitForResponse()'s doc comment in the Elasticsearch log exporter claims a request timeout (set via SetTimeoutMs()) "arrives here as a TimedOut session event." That's incorrect: no HttpClient implementation in this repo dispatches SessionState::TimedOut. The curl client maps CURLE_OPERATION_TIMEDOUT to SendFailed, indistinguishable from any other transport failure, which the comment now says.

This PR originally also removed the unreachable TimedOut enumerator and its four dead branches (Elasticsearch and OTLP HTTP exporters). A reviewer correctly pointed out that's not something to do directly: SessionState is part of an installed public header and the event contract for any out-of-tree HttpClient implementation, so removing an enumerator needs to go through docs/deprecation-process.md (SIG discussion, a [DEPRECATION] issue, a DEPRECATED entry, a full deprecation cycle before removal). Issue #4604 is also still needs-triage, so it hasn't been accepted for a specific direction yet.

Scoped this PR down to just the doc comment fix, which needs no process to correct. Left the actual enum question (dispatch TimedOut for real vs. deprecate-and-remove it) for the SIG to decide on the issue.

Ran the full test suite locally, all passing.

  • CHANGELOG.md updated for non-trivial changes

@codecov

codecov Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.66%. Comparing base (754928d) to head (b3151b9).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4647   +/-   ##
=======================================
  Coverage   86.66%   86.66%           
=======================================
  Files         525      525           
  Lines       20481    20481           
=======================================
  Hits        17748    17748           
  Misses       2733     2733           
Files with missing lines Coverage Δ
...orters/elasticsearch/src/es_log_record_exporter.cc 47.73% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nikhilbhatia08

Copy link
Copy Markdown
Contributor

Thanks for the investigation — the diagnosis is right, but I don't think we can remove the enumerator. SessionState is in an installed public header and is the event contract for any HttpClient implementation, including the out-of-tree ones we explicitly support. Removing it breaks their build, so it would need a DEPRECATED entry and a deprecation cycle per docs/deprecation-process.md.

Also, #4604 is still needs-triage that needs a SIG discussion.

No HttpClient implementation in this repo ever dispatched TimedOut.
The curl client maps CURLE_OPERATION_TIMEDOUT to SendFailed like any
other transport error, so the four branches handling TimedOut in the
Elasticsearch and OTLP HTTP exporters were unreachable, and the doc
comment claiming a timeout arrives as a TimedOut event was incorrect.

Removed the dead branches and fixed the comment instead of making
TimedOut reachable, since that would change behavior for any code
already handling a timeout via SendFailed today.

Fixes open-telemetry#4604
Removing SessionState::TimedOut requires going through the project's
formal deprecation process (docs/deprecation-process.md), since it is
part of an installed public header and the event contract for any
out-of-tree HttpClient implementation. Issue open-telemetry#4604 is also still
needs-triage, not yet accepted for a specific direction.

Reverted the enum removal and the four now-restored dead branches in
the Elasticsearch and OTLP HTTP exporters. Kept only the doc comment
fix on ResponseHandler::waitForResponse(), which was simply incorrect
about a timeout arriving as a TimedOut event when it actually arrives
as SendFailed, and needs no process to correct.

Addresses review feedback from nikhilbhatia08.
@om7057
om7057 force-pushed the fix/remove-dead-timedout-session-state branch 2 times, most recently from 11b61f0 to b3151b9 Compare September 29, 2026 15:11
@om7057 om7057 changed the title [HTTP CLIENT] Remove dead SessionState::TimedOut, never dispatched by any client [EXPORTER] Fix incorrect doc comment about SessionState::TimedOut in the Elasticsearch exporter Sep 29, 2026
@om7057

om7057 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

@nikhilbhatia08 Understood and thanks.
I checked docs/deprecation-process.md and you're right that removing a public enumerator needs SIG discussion and a proper deprecation cycle, not a direct removal.
Also I missed that #4604 is still needs-triage.

I have scoped this down to just the doc comment fix, which was simply wrong about the event and needs no process to correct.
Reverted the enum removal and the four dead branches back to how they were. Left the actual TimedOut question (dispatch it for real vs. deprecate-and-remove) for the SIG to decide on the issue.

@marcalff marcalff added the discuss To discuss in SIG meeting label Sep 30, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discuss To discuss in SIG meeting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] SessionState::TimedOut is never dispatched, so every timeout surfaces as SendFailed

3 participants