You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -311,19 +312,19 @@ type LogsData = Box<(LogRecord, InstrumentationScope)>;
311
312
// - During the export process:
312
313
// - The worker thread retrieves records from the log record queue until `max_export_batch_size` is reached or the queue is empty.
313
314
// - The retrieved records are processed in batches and passed to the exporter.
314
-
// - The `ExportLog` message in the control queue explicitly triggers an export operation:
315
-
// - It is generated when the current batch size reaches `max_export_batch_size`.
316
-
// - A flag ensures only one `ExportLog` message is sent at a time to prevent redundant processing.
317
-
// - This message prompts the worker thread to process and export the current batch immediately, regardless of the scheduled delay.
318
315
// - The exporter's `export()` method receives references to the log records and `InstrumentationScope`.
319
316
// - If the exporter requires retaining the log records (e.g., for retries or asynchronous operations), it must **clone** the records inside the `export()` implementation.
320
317
// - After successful export:
321
318
// - The original boxed records are dropped, releasing heap memory.
322
319
// - Export is triggered in the following scenarios:
323
-
// - When the batch size reaches `max_export_batch_size`.
320
+
// - When the batch size reaches `max_export_batch_size`, resulting in `ExportLog` control message being sent to the worker thread.
324
321
// - When the scheduled delay timer expires.
325
-
// - When `force_flush` is called.
326
-
// - During processor shutdown.
322
+
// - When `force_flush` is called by the application, resulting in a `ForceFlush` control message being sent to the worker thread.
323
+
// - During processor shutdown initiated by the application, resulting in a `Shutdown` control message being sent to the worker thread.
324
+
// - Generation of `ExportLog` control message:
325
+
// - The `ExportLog` control message is generated by the application thread when a new record is added to the log record queue, and the current batch size reaches `max_export_batch_size`.
326
+
// - To prevent redundant messages, the `ExportLog` message is only sent if the previous one has been processed by the worker thread.
327
+
// - Upon receiving this message, the worker thread immediately processes and exports the current batch, overriding any scheduled delay.
0 commit comments