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 (texinfo html)
|
||||||
#:use-module (squee)
|
#:use-module (squee)
|
||||||
#:use-module (json)
|
#:use-module (json)
|
||||||
|
#:use-module (fibers)
|
||||||
#:use-module (knots parallelism)
|
#:use-module (knots parallelism)
|
||||||
#:use-module (knots resource-pool)
|
#:use-module (knots resource-pool)
|
||||||
#:use-module (prometheus)
|
#:use-module (prometheus)
|
||||||
|
|
@ -721,6 +722,16 @@
|
||||||
|
|
||||||
(with-exception-handler
|
(with-exception-handler
|
||||||
(lambda (exn)
|
(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
|
(case (most-appropriate-mime-type
|
||||||
mime-types
|
mime-types
|
||||||
'(text/html application/json))
|
'(text/html application/json))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue