@@ -291,20 +291,22 @@ impl Host {
291
291
// When the provider is shutting down, don't restart it
292
292
if shutdown. load ( Ordering :: Relaxed ) {
293
293
trace ! (
294
- "provider @ [{}] exited with `{status:?}` but will not be restarted since it's shutting down" ,
295
- path. display( )
294
+ path = ?path. display( ) ,
295
+ status = ?status,
296
+ "provider exited but will not be restarted since it's shutting down" ,
296
297
) ;
297
298
// Avoid a hot loop by waiting 1s before checking the status again
298
299
tokio:: time:: sleep ( Duration :: from_secs ( 1 ) ) . await ;
299
300
continue ;
300
301
}
301
302
302
303
warn ! (
303
- "restarting provider @ [{}] that exited with `{status:?}`" ,
304
- path. display( )
304
+ path = ?path. display( ) ,
305
+ status = ?status,
306
+ "restarting provider that exited while being supervised" ,
305
307
) ;
306
308
307
- let Ok ( ( Ok ( host_data) , new_config_bundle) ) = self
309
+ let ( host_data, new_config_bundle) = match self
308
310
. prepare_provider_config (
309
311
& config_names,
310
312
claims_token. as_ref ( ) ,
@@ -319,11 +321,20 @@ impl Host {
319
321
. context ( "failed to serialize provider data" ) ,
320
322
Arc :: new ( RwLock :: new ( config) ) ,
321
323
)
322
- } )
323
- else {
324
- error ! ( "failed to prepare provider host data while restarting" ) ;
325
- shutdown. store ( true , Ordering :: Relaxed ) ;
326
- return ;
324
+ } ) {
325
+ Ok ( ( Ok ( host_data) , new_config_bundle) ) => {
326
+ ( host_data, new_config_bundle)
327
+ }
328
+ Err ( e) => {
329
+ error ! ( err = ?e, "failed to prepare provider host data while restarting" ) ;
330
+ shutdown. store ( true , Ordering :: Relaxed ) ;
331
+ return ;
332
+ }
333
+ Ok ( ( Err ( e) , _) ) => {
334
+ error ! ( err = ?e, "failed to serialize provider host data while restarting" ) ;
335
+ shutdown. store ( true , Ordering :: Relaxed ) ;
336
+ return ;
337
+ }
327
338
} ;
328
339
329
340
// Stop the config watcher and start a new one with the new config bundle
@@ -339,7 +350,7 @@ impl Host {
339
350
// Restart the provider by attempting to re-execute the binary with the same
340
351
// host data
341
352
let Ok ( child_cmd) = provider_command ( & path, host_data) . await else {
342
- error ! ( "failed to restart provider @ [{}]" , path . display ( ) ) ;
353
+ error ! ( path = ?path . display ( ) , "failed to restart provider" ) ;
343
354
shutdown. store ( true , Ordering :: Relaxed ) ;
344
355
return ;
345
356
} ;
@@ -351,8 +362,9 @@ impl Host {
351
362
}
352
363
Err ( e) => {
353
364
error ! (
354
- "failed to wait for provider @ [{}] to execute: {e}" ,
355
- path. display( )
365
+ path = ?path. display( ) ,
366
+ err = ?e,
367
+ "failed to wait for provider to execute" ,
356
368
) ;
357
369
358
370
shutdown. store ( true , Ordering :: Relaxed ) ;
0 commit comments