Skip to content

Commit 1904d4b

Browse files
authored
Remove redundant shutdown check in batchlogprocessor (#2514)
1 parent 9aea826 commit 1904d4b

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

opentelemetry-sdk/src/logs/log_processor.rs

+3-13
Original file line numberDiff line numberDiff line change
@@ -352,19 +352,9 @@ impl LogProcessor for BatchLogProcessor {
352352
}
353353

354354
fn shutdown(&self) -> LogResult<()> {
355-
// test and set is_shutdown flag if it is not set
356-
if self
357-
.is_shutdown
358-
.swap(true, std::sync::atomic::Ordering::Relaxed)
359-
{
360-
otel_warn!(
361-
name: "BatchLogProcessor.Shutdown.ProcessorShutdown",
362-
message = "BatchLogProcessor has been shutdown. No further logs will be emitted."
363-
);
364-
return LogResult::Err(LogError::AlreadyShutdown(
365-
"BatchLogProcessor is already shutdown".into(),
366-
));
367-
}
355+
// Set is_shutdown to true
356+
self.is_shutdown
357+
.store(true, std::sync::atomic::Ordering::Relaxed);
368358

369359
let dropped_logs = self.dropped_logs_count.load(Ordering::Relaxed);
370360
let max_queue_size = self.max_queue_size;

0 commit comments

Comments
 (0)