cbaines pushed a commit to branch master
in repository data-service.
commit 46b4c87e92a1470198e6c9c6cb1d7e3556f3a3a7
Author: Christopher Baines <[email protected]>
AuthorDate: Thu Jan 18 14:40:05 2024 +0000
Show backtraces when using parallel fibers and resource pools
---
guix-data-service/utils.scm | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/guix-data-service/utils.scm b/guix-data-service/utils.scm
index e1c6d84..09f47f8 100644
--- a/guix-data-service/utils.scm
+++ b/guix-data-service/utils.scm
@@ -387,7 +387,11 @@ available. Return the resource once PROC has returned."
(lambda ()
(call-with-values
(lambda ()
- (proc resource))
+ (with-throw-handler #t
+ (lambda ()
+ (proc resource))
+ (lambda _
+ (backtrace))))
(lambda vals
(put-message pool `(return ,resource))
(apply values vals))))
@@ -433,7 +437,12 @@ available. Return the resource once PROC has returned."
(lambda (exn)
(put-message reply (cons 'exception exn)))
(lambda ()
- (call-with-values thunk
+ (call-with-values
+ (lambda ()
+ (with-throw-handler #t
+ thunk
+ (lambda _
+ (backtrace))))
(lambda vals
(put-message reply vals))))
#:unwind? #t))