Shell: Catch timeout errors and improve reporting
This commit is contained in:
parent
80587889d5
commit
b5499b37d5
@ -267,7 +267,8 @@ let rec validation_worker_loop pipeline =
|
|||||||
| Error [Exn Lwt.Canceled | Canceled | Exn Lwt_pipe.Closed] ->
|
| Error [Exn Lwt.Canceled | Canceled | Exn Lwt_pipe.Closed] ->
|
||||||
Lwt.return_unit
|
Lwt.return_unit
|
||||||
| Error ([ Block_validator_errors.Invalid_block _
|
| Error ([ Block_validator_errors.Invalid_block _
|
||||||
| Block_validator_errors.Unavailable_protocol _ ] as err ) ->
|
| Block_validator_errors.Unavailable_protocol _
|
||||||
|
| Timeout] as err ) ->
|
||||||
(* Propagate the error to the peer validator. *)
|
(* Propagate the error to the peer validator. *)
|
||||||
pipeline.errors <- pipeline.errors @ err ;
|
pipeline.errors <- pipeline.errors @ err ;
|
||||||
Lwt_canceler.cancel pipeline.canceler >>= fun () ->
|
Lwt_canceler.cancel pipeline.canceler >>= fun () ->
|
||||||
|
@ -504,6 +504,9 @@ module Make
|
|||||||
end >>= function
|
end >>= function
|
||||||
| Ok () ->
|
| Ok () ->
|
||||||
loop ()
|
loop ()
|
||||||
|
| Error ([Timeout] as errs) ->
|
||||||
|
Logger.lwt_log_notice "Worker terminated with timeout" >>= fun () ->
|
||||||
|
do_close (Some errs)
|
||||||
| Error errs ->
|
| Error errs ->
|
||||||
Logger.lwt_log_error
|
Logger.lwt_log_error
|
||||||
"@[<v 0>Worker crashed:@,%a@]"
|
"@[<v 0>Worker crashed:@,%a@]"
|
||||||
|
Loading…
Reference in New Issue
Block a user