Skip to content

Commit c426db4

Browse files
committed
Address PR comments
1 parent 158524a commit c426db4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

opentelemetry-sdk/src/logs/log_processor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl LogProcessor for BatchLogProcessor {
306306
// If not, send a control message to export logs.
307307
// `export_log_message_sent` is set to false ONLY when the worker thread has processed the control message.
308308

309-
if !self.export_log_message_sent.load(Ordering::Acquire) {
309+
if !self.export_log_message_sent.load(Ordering::Relaxed) {
310310
// This is a cost-efficient check as atomic load operations do not require exclusive access to cache line.
311311
// Perform atomic swap to `export_log_message_sent` ONLY when the atomic load operation above returns false.
312312
// Atomic swap/compare_exchange operations require exclusive access to cache line on most processor architectures.
@@ -493,6 +493,9 @@ impl BatchLogProcessor {
493493

494494
match message_receiver.recv_timeout(remaining_time) {
495495
Ok(BatchMessage::ExportLog(export_log_message_sent)) => {
496+
// Reset the export log message sent flag now it has has been processed.
497+
export_log_message_sent.store(false, Ordering::Relaxed);
498+
496499
otel_debug!(
497500
name: "BatchLogProcessor.ExportingDueToBatchSize",
498501
);
@@ -505,9 +508,6 @@ impl BatchLogProcessor {
505508
&current_batch_size,
506509
&config,
507510
);
508-
509-
// Reset the export log message sent flag now it has has been processed.
510-
export_log_message_sent.store(false, Ordering::Release);
511511
}
512512
Ok(BatchMessage::ForceFlush(sender)) => {
513513
otel_debug!(name: "BatchLogProcessor.ExportingDueToForceFlush");

0 commit comments

Comments
 (0)