aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-09-11 13:08:55 +0100
committerChristopher Baines <mail@cbaines.net>2023-09-12 13:11:00 +0100
commita9f3ed8769e22b134ef8e216057dd23b006eb95c (patch)
tree4a4974e58cdb87868fc22c9037f5783ac6bddf92 /scripts
parent66de9a4a229499c1e1ec57ea374f8bfe21a7f1fc (diff)
downloadnar-herder-a9f3ed8769e22b134ef8e216057dd23b006eb95c.tar
nar-herder-a9f3ed8769e22b134ef8e216057dd23b006eb95c.tar.gz
Name the fibers threads
To help with debugging.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in
index 03205d1..1dfbc6c 100644
--- a/scripts/nar-herder.in
+++ b/scripts/nar-herder.in
@@ -50,6 +50,7 @@
(logging port-log)
(prometheus)
(fibers)
+ (fibers scheduler)
(fibers conditions)
(fibers web server)
((guix ui) #:select (read/eval string->duration))
@@ -679,6 +680,22 @@
(lambda ()
(run-fibers
(lambda ()
+ (let* ((current (current-scheduler))
+ (schedulers
+ (cons current (scheduler-remote-peers current))))
+ (for-each
+ (lambda (i sched)
+ (spawn-fiber
+ (lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name
+ (string-append "fibers " (number->string i))))
+ (const #t)))
+ sched))
+ (iota (length schedulers))
+ schedulers))
+
(log-msg 'INFO "starting server, listening on "
(assq-ref opts 'host) ":" (assq-ref opts 'port))