From a9f3ed8769e22b134ef8e216057dd23b006eb95c Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 11 Sep 2023 13:08:55 +0100 Subject: Name the fibers threads To help with debugging. --- scripts/nar-herder.in | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'scripts') 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)) -- cgit v1.2.3