Commit Graph

4 Commits

Author SHA1 Message Date
Ludovic Courtès d5ce7bcfa2
workers: Display backtrace in pre-unwind handler.
* guix/workers.scm (worker-thunk): Add (const #f) as the 'catch'
handler, and move previous handler as pre-unwind handler.  Protect
against 'make-stack' returning #f.
2017-11-17 10:47:56 +01:00
Ludovic Courtès 232b3d3101
workers: 'pool-idle?' returns true only if the workers are idle.
Fixes <https://bugs.gnu.org/28779>.
Reported by Eric Bavier <bavier@cray.com>.

* guix/workers.scm (<pool>)[busy]: New field.
(worker-thunk): Add #:idle and #:busy and use them.
(make-pool): Pass #:busy and #:idle to 'worker-thunk'.  Pass a 'busy'
value to '%make-pool'.
* guix/workers.scm (pool-idle?): Check whether 'pool-busy' returns zero
and adjust docstring.
2017-11-17 10:10:30 +01:00
Ludovic Courtès 8902d0f267
scripts: Set thread names.
This allows 'guix publish' threads as well as 'guix substitute' and
'guix offload' processes to be properly labeled in 'top', 'pstree', etc.

* guix/workers.scm (worker-thunk): Add #:thread-name parameter and honor it.
(make-pool): Likewise.
* guix/scripts/publish.scm (http-write): Add calls to 'set-thread-name'
in bodies of 'call-with-new-thread'.
(guix-publish): Call 'set-thread-name'.   Pass #:thread-name to 'make-pool'.
* guix/scripts/offload.scm (guix-offload): Call 'set-thread-name'.
* guix/scripts/substitute.scm (guix-substitute): Likewise.
2017-05-28 23:13:39 +02:00
Ludovic Courtès 1563d6c79f
Add (guix workers).
* guix/workers.scm, tests/workers.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
* .dir-locals.el: Add rule for 'eventually'.
2017-04-18 23:17:17 +02:00