From aeb7b55e761fa5f384aa37eaae181c1eb8b14132 Mon Sep 17 00:00:00 2001 From: owent Date: Thu, 16 Nov 2023 10:23:39 +0800 Subject: [PATCH] Fix compile problem without `ENABLE_ASYNC_EXPORT` --- exporters/otlp/src/otlp_grpc_client.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/exporters/otlp/src/otlp_grpc_client.cc b/exporters/otlp/src/otlp_grpc_client.cc index 84f402116a..1c06875a9a 100644 --- a/exporters/otlp/src/otlp_grpc_client.cc +++ b/exporters/otlp/src/otlp_grpc_client.cc @@ -125,6 +125,7 @@ static std::string GetFileContentsOrInMemoryContents(const std::string &file_pat return contents; } +#ifdef ENABLE_ASYNC_EXPORT static void MaybeSpawnBackgroundThread(std::shared_ptr async_data) { std::lock_guard lock_guard{async_data->background_thread_m}; @@ -304,7 +305,7 @@ static sdk::common::ExportResult InternalDelegateAsyncExport( return opentelemetry::sdk::common::ExportResult::kSuccess; } - +#endif } // namespace #ifdef ENABLE_ASYNC_EXPORT @@ -622,6 +623,7 @@ bool OtlpGrpcClient::Shutdown(std::chrono::microseconds timeout) noexcept { return true; } + is_shutdown_ = true; async_data_->cq.Shutdown(); return ForceFlush(timeout);