From cba5a6e918f2a3b9368df98a598a1d415dff94ee Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 22 Apr 2023 15:01:22 +0100 Subject: Add some more exception handling around hooks --- guix-build-coordinator/coordinator.scm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'guix-build-coordinator') diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm index 67ede3f..f6889e5 100644 --- a/guix-build-coordinator/coordinator.scm +++ b/guix-build-coordinator/coordinator.scm @@ -1096,15 +1096,23 @@ " exception: " exn)) #:unwind? #t)) (lambda () - (while #t - (match (datastore-list-unprocessed-hook-events datastore event-name 1) - (() - (wait-condition-variable condvar - mtx - (+ (time-second (current-time)) - wait-timeout-seconds))) - (((id event arguments)) - (process-event id event arguments handler))))) + (with-throw-handler #t + (lambda () + (while #t + (match (datastore-list-unprocessed-hook-events datastore event-name 1) + (() + (wait-condition-variable condvar + mtx + (+ (time-second (current-time)) + wait-timeout-seconds))) + (((id event arguments)) + (process-event id event arguments handler))))) + (lambda (key . args) + (log-msg + (build-coordinator-logger build-coordinator) + 'CRITICAL + "error in build allocator thread: " key " " args) + (backtrace)))) #:unwind? #t)))) condvar)) -- cgit v1.2.3