Improve thread pool exception logging
This commit is contained in:
parent
13f1118576
commit
f549bee282
1 changed files with 10 additions and 11 deletions
|
@ -251,7 +251,15 @@ arguments of the thread pool procedure."
|
|||
(vector-set! thread-proc-vector
|
||||
thread-index
|
||||
proc)
|
||||
(with-throw-handler #t
|
||||
(with-exception-handler
|
||||
(lambda (exn)
|
||||
(when (log-exception? exn)
|
||||
(simple-format
|
||||
(current-error-port)
|
||||
"thread-pool: exception running ~A\n" proc)
|
||||
(print-backtrace-and-exception/knots
|
||||
exn))
|
||||
(raise-exception exn))
|
||||
(lambda ()
|
||||
(call-with-values
|
||||
(lambda ()
|
||||
|
@ -262,16 +270,7 @@ arguments of the thread pool procedure."
|
|||
(cons (/ (- (get-internal-real-time)
|
||||
start-time)
|
||||
internal-time-units-per-second)
|
||||
vals))))
|
||||
(lambda args
|
||||
(when (match args
|
||||
(('%exception exn)
|
||||
(log-exception? exn))
|
||||
(_ #t))
|
||||
(simple-format
|
||||
(current-error-port)
|
||||
"thread-pool: exception: ~A\n" args)
|
||||
(backtrace)))))
|
||||
vals))))))
|
||||
#:unwind? #t)))
|
||||
(put-message reply
|
||||
response)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue