@@ -132,7 +132,6 @@ pub struct BatchLogProcessor {
132132 message_sender : SyncSender < BatchMessage > , // Control channel to store control messages for the worker thread
133133 handle : Mutex < Option < thread:: JoinHandle < ( ) > > > ,
134134 forceflush_timeout : Duration ,
135- shutdown_timeout : Duration ,
136135 export_log_message_sent : Arc < AtomicBool > ,
137136 current_batch_size : Arc < AtomicUsize > ,
138137 max_export_batch_size : usize ,
@@ -256,7 +255,7 @@ impl LogProcessor for BatchLogProcessor {
256255 }
257256 }
258257
259- fn shutdown ( & self ) -> OTelSdkResult {
258+ fn shutdown_with_timeout ( & self , timeout : Duration ) -> OTelSdkResult {
260259 let dropped_logs = self . dropped_logs_count . load ( Ordering :: Relaxed ) ;
261260 let max_queue_size = self . max_queue_size ;
262261 if dropped_logs > 0 {
@@ -272,7 +271,7 @@ impl LogProcessor for BatchLogProcessor {
272271 match self . message_sender . try_send ( BatchMessage :: Shutdown ( sender) ) {
273272 Ok ( _) => {
274273 receiver
275- . recv_timeout ( self . shutdown_timeout )
274+ . recv_timeout ( timeout )
276275 . map ( |_| {
277276 // join the background thread after receiving back the
278277 // shutdown signal
@@ -287,7 +286,7 @@ impl LogProcessor for BatchLogProcessor {
287286 name: "BatchLogProcessor.Shutdown.Timeout" ,
288287 message = "BatchLogProcessor shutdown timing out."
289288 ) ;
290- OTelSdkError :: Timeout ( self . shutdown_timeout )
289+ OTelSdkError :: Timeout ( timeout )
291290 }
292291 _ => {
293292 otel_error ! (
@@ -489,7 +488,6 @@ impl BatchLogProcessor {
489488 message_sender,
490489 handle : Mutex :: new ( Some ( handle) ) ,
491490 forceflush_timeout : Duration :: from_secs ( 5 ) , // TODO: make this configurable
492- shutdown_timeout : Duration :: from_secs ( 5 ) , // TODO: make this configurable
493491 dropped_logs_count : AtomicUsize :: new ( 0 ) ,
494492 max_queue_size,
495493 export_log_message_sent : Arc :: new ( AtomicBool :: new ( false ) ) ,
0 commit comments