Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ Increment the:
request body on a 32-bit build
[#4630](https://github.com/open-telemetry/opentelemetry-cpp/pull/4630)

* [BUG] End the Elasticsearch exporter's wait on a read or write error
[#4331](https://github.com/open-telemetry/opentelemetry-cpp/pull/4331)

## [1.29.0] 2026-09-13

* [RELEASE] Bump main branch to 1.29.0-dev (#4259)
Expand Down
4 changes: 4 additions & 0 deletions exporters/elasticsearch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ if(OTELCPP_BUILD_TESTING)
TARGET es_log_record_exporter_test
TEST_PREFIX exporter.
TEST_LIST es_log_record_exporter_test)

# These cases exist to catch a wait that never returns. Without a per test
# bound a regression stalls the job instead of failing it.
set_tests_properties(${es_log_record_exporter_test} PROPERTIES TIMEOUT 30)
endif() # OTELCPP_BUILD_TESTING
8 changes: 6 additions & 2 deletions exporters/elasticsearch/src/es_log_record_exporter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ class ResponseHandler : public http_client::EventHandler

/**
* A method the user calls to block their thread until the request has either produced a
* response or failed. The longest duration is the timeout of the request, set by
* SetTimeoutMs(), which arrives here as a TimedOut session event.
* response or failed. It has no deadline of its own and relies on the HTTP client
* reporting one of the terminal session states.
*/
bool waitForResponse()
{
Expand Down Expand Up @@ -183,11 +183,15 @@ class ResponseHandler : public http_client::EventHandler
OTEL_INTERNAL_LOG_ERROR("[ES Log Exporter] Network error");
recordCompletion(CompletionState::Failure);
break;
// Both of these end the session, so each has to release the waiter. Without that a
// synchronous export whose transfer fails this way blocks until the process ends.
case http_client::SessionState::ReadError:
OTEL_INTERNAL_LOG_DEBUG("[ES Log Exporter] Read error");
recordCompletion(CompletionState::Failure);
break;
case http_client::SessionState::WriteError:
OTEL_INTERNAL_LOG_DEBUG("[ES Log Exporter] Write error");
recordCompletion(CompletionState::Failure);
break;
case http_client::SessionState::Cancelled:
OTEL_INTERNAL_LOG_ERROR("[ES Log Exporter] (manually) cancelled");
Expand Down
Loading
Loading