@@ -18,14 +18,16 @@ pub enum LogError {
1818 #[ error( "Exporter timed out after {} seconds" , . 0 . as_secs( ) ) ]
1919 ExportTimedOut ( Duration ) ,
2020
21+ /// The export client failed while holding the client lock. It is not
22+ /// possible to complete the shutdown and a retry will not help.
23+ /// This is something that should not happen and should likely emit some diagnostic.
24+ #[ error( "export client failed while holding lock; cannot retry." ) ]
25+ ClientFailed ( String ) ,
26+
2127 /// Processor is already shutdown
2228 #[ error( "{0} already shutdown" ) ]
2329 AlreadyShutdown ( String ) ,
2430
25- /// Mutex lock poisoning
26- #[ error( "mutex lock poisioning for {0}" ) ]
27- MutexPoisoned ( String ) ,
28-
2931 /// Other errors propagated from log SDK that weren't covered above.
3032 #[ error( transparent) ]
3133 Other ( #[ from] Box < dyn std:: error:: Error + Send + Sync + ' static > ) ,
@@ -54,9 +56,10 @@ impl From<&'static str> for LogError {
5456
5557impl < T > From < PoisonError < T > > for LogError {
5658 fn from ( err : PoisonError < T > ) -> Self {
57- LogError :: Other ( err. to_string ( ) . into ( ) )
59+ LogError :: ClientFailed ( err. to_string ( ) . into ( ) )
5860 }
5961}
62+
6063/// Wrap type for string
6164#[ derive( Error , Debug ) ]
6265#[ error( "{0}" ) ]
@@ -66,9 +69,11 @@ struct Custom(String);
6669#[ derive( Error , Debug ) ]
6770#[ non_exhaustive]
6871pub enum ShutdownError {
69- /// Mutex lock poisoning
70- #[ error( "mutex lock poisioning for {0}" ) ]
71- MutexPoisoned ( String ) ,
72+ /// The export client failed while holding the client lock. It is not
73+ /// possible to complete the shutdown and a retry will not help.
74+ /// This is something that should not happen and should likely emit some diagnostic.
75+ #[ error( "export client failed while holding lock; cannot retry." ) ]
76+ ClientFailed ( String ) ,
7277
7378 /// Other errors propagated from log SDK that weren't covered above.
7479 #[ error( transparent) ]
@@ -77,6 +82,6 @@ pub enum ShutdownError {
7782
7883impl < T > From < PoisonError < T > > for ShutdownError {
7984 fn from ( err : PoisonError < T > ) -> Self {
80- ShutdownError :: Other ( err . to_string ( ) . into ( ) )
85+ ShutdownError :: ClientFailed ( format ! ( "Mutex poisoned during shutdown: {}" , err ) )
8186 }
8287}
0 commit comments