Log resource pool stats on errors
This commit is contained in:
parent
52a307612f
commit
d6cfd780e8
1 changed files with 11 additions and 0 deletions
|
|
@ -35,6 +35,7 @@
|
|||
#:use-module (texinfo html)
|
||||
#:use-module (squee)
|
||||
#:use-module (json)
|
||||
#:use-module (fibers)
|
||||
#:use-module (knots parallelism)
|
||||
#:use-module (knots resource-pool)
|
||||
#:use-module (prometheus)
|
||||
|
|
@ -721,6 +722,16 @@
|
|||
|
||||
(with-exception-handler
|
||||
(lambda (exn)
|
||||
(when (resource-pool-timeout-error? exn)
|
||||
(spawn-fiber
|
||||
(lambda ()
|
||||
(let* ((pool (resource-pool-timeout-error-pool exn))
|
||||
(stats (resource-pool-stats pool)))
|
||||
(simple-format (current-error-port)
|
||||
"resource pool timeout error: ~A, ~A\n"
|
||||
pool
|
||||
stats)))))
|
||||
|
||||
(case (most-appropriate-mime-type
|
||||
mime-types
|
||||
'(text/html application/json))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue