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/utils | |
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/utils')
-rw-r--r-- | guix-build-coordinator/utils/fibers.scm | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/guix-build-coordinator/utils/fibers.scm b/guix-build-coordinator/utils/fibers.scm index 2dfb087..f6dba70 100644 --- a/guix-build-coordinator/utils/fibers.scm +++ b/guix-build-coordinator/utils/fibers.scm @@ -41,18 +41,17 @@ arguments of the worker thread procedure." (lambda (exn) (cons 'worker-thread-error exn)) (lambda () - (with-exception-handler - (lambda (exn) - (simple-format - (current-error-port) - "worker-thread: exception: ~A\n" exn) - (backtrace) - (raise-exception exn)) + (with-throw-handler #t (lambda () (call-with-values (lambda () (apply proc args)) - (lambda vals vals))))) + (lambda vals vals))) + (lambda (key . args) + (simple-format + (current-error-port) + "worker-thread: exception: ~A ~A\n" key args) + (backtrace)))) #:unwind? #t))))) (loop))))))) (iota parallelism)) |