Skip to content

Commit 26f9a4a

Browse files
AaronRMscottgerring
authored andcommitted
Merge branch 'main' into aaronm-retry
2 parents d9b985b + ad88615 commit 26f9a4a

File tree

1 file changed

+5
-9
lines changed
  • opentelemetry-otlp/src/exporter/tonic

1 file changed

+5
-9
lines changed

opentelemetry-otlp/src/exporter/tonic/logs.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,11 @@ impl LogExporter for TonicLogsClient {
118118
.await
119119
}
120120

121-
fn shutdown_with_timeout(&self, _timeout: time::Duration) -> OTelSdkResult {
122-
// TODO: Implement actual shutdown
123-
// Due to the use of tokio::sync::Mutex to guard
124-
// the inner client, we need to await the call to lock the mutex
125-
// and that requires async runtime.
126-
// It is possible to fix this by using
127-
// a dedicated thread just to handle shutdown.
128-
// But for now, we just return Ok.
129-
Ok(())
121+
fn shutdown(&mut self) -> OTelSdkResult {
122+
match self.inner.take() {
123+
Some(_) => Ok(()), // Successfully took `inner`, indicating a successful shutdown.
124+
None => Err(OTelSdkError::AlreadyShutdown), // `inner` was already `None`, meaning it's already shut down.
125+
}
130126
}
131127

132128
fn set_resource(&mut self, resource: &opentelemetry_sdk::Resource) {

0 commit comments

Comments
 (0)