diff options
author | Christopher Baines <mail@cbaines.net> | 2021-01-22 10:01:23 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2021-01-22 10:01:23 +0000 |
commit | 3673bda6064038bd56469993d4df5487b7054a53 (patch) | |
tree | 2008a6928d566940a2f635d3244e2af037d3c972 /guix-build-coordinator/coordinator.scm | |
parent | 9e696733ac638acbb3c47197b2484cb6ecbc76a0 (diff) | |
download | build-coordinator-3673bda6064038bd56469993d4df5487b7054a53.tar build-coordinator-3673bda6064038bd56469993d4df5487b7054a53.tar.gz |
Don't use with-exception-handler with (backtrace)
With with-exception-handler being called with #:unwind? #f (implicitly). This
breaks Guile internals used by (backtrace) [1], meaning you get a different
exception/backtrace when Guile itself breaks.
This should avoid the "string->number: Wrong type argument in position
1 (expecting string): #f" exception I've been haunted by for the last year.
1: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=46009
Diffstat (limited to 'guix-build-coordinator/coordinator.scm')
-rw-r--r-- | guix-build-coordinator/coordinator.scm | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm index c6a71f5..f874c48 100644 --- a/guix-build-coordinator/coordinator.scm +++ b/guix-build-coordinator/coordinator.scm @@ -467,27 +467,15 @@ (metric-increment failure-counter-metric) (atomic-box-set! allocation-needed #t)) (lambda () - (with-exception-handler - (lambda (exn) - (with-exception-handler - (lambda (exn) - (simple-format - (current-error-port) - "exception when printing backtrace: ~A\n" - exn) - (raise-exception exn)) - (lambda () - (backtrace) - (simple-format #t "\nfinished printing backtrace\n") - (force-output)) - #:unwind? #t) - (raise-exception exn)) + (with-throw-handler #t (lambda () (with-timeout (* 1000 60 10) ; 10 minutes (raise-exception (make-exception-with-message "timeout allocating builds")) (allocate-builds build-coordinator)) - (metric-increment success-counter-metric)))) + (metric-increment success-counter-metric)) + (lambda (key . args) + (backtrace)))) #:unwind? #t)) #:buckets ((@@ (prometheus) exponential-histogram-buckets) ; TODO #:start 1 |