aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-08-09 20:13:33 +0100
committerChristopher Baines <mail@cbaines.net>2023-08-09 20:15:13 +0100
commit414ff3c84a376a87a8661e91a5fd97709d552074 (patch)
tree24e348664398f554d9b8c69f812221b0445c8027
parentc5412d66b058051b627ea0fe5c409860289ad1f1 (diff)
downloadbuild-coordinator-414ff3c84a376a87a8661e91a5fd97709d552074.tar
build-coordinator-414ff3c84a376a87a8661e91a5fd97709d552074.tar.gz
Name more threads
To help with debugging.
-rw-r--r--guix-build-coordinator/agent-messaging/http/server.scm5
-rw-r--r--guix-build-coordinator/coordinator.scm11
-rw-r--r--guix-build-coordinator/utils.scm12
3 files changed, 28 insertions, 0 deletions
diff --git a/guix-build-coordinator/agent-messaging/http/server.scm b/guix-build-coordinator/agent-messaging/http/server.scm
index e3ced38..aaa88cb 100644
--- a/guix-build-coordinator/agent-messaging/http/server.scm
+++ b/guix-build-coordinator/agent-messaging/http/server.scm
@@ -431,6 +431,11 @@ port. Also, the port used can be changed by passing the --port option.\n"
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name "compute hash"))
+ (const #t))
+
(with-exception-handler
(lambda (exn)
(put-message channel
diff --git a/guix-build-coordinator/coordinator.scm b/guix-build-coordinator/coordinator.scm
index 3dd49e3..200dc21 100644
--- a/guix-build-coordinator/coordinator.scm
+++ b/guix-build-coordinator/coordinator.scm
@@ -998,6 +998,11 @@
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name "allocator"))
+ (const #t))
+
(with-exception-handler
(lambda (exn)
(simple-format (current-error-port)
@@ -1120,6 +1125,12 @@
(condvar (make-condition-variable)))
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name
+ (symbol->string event-name)))
+ (const #t))
+
(lock-mutex mtx)
(while #t
(with-exception-handler
diff --git a/guix-build-coordinator/utils.scm b/guix-build-coordinator/utils.scm
index 17cabc8..a91e771 100644
--- a/guix-build-coordinator/utils.scm
+++ b/guix-build-coordinator/utils.scm
@@ -1076,6 +1076,12 @@ References: ~a~%"
(if (procedure? thread-count-parameter)
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name
+ (string-append name " q t")))
+ (const #t))
+
(while #t
(sleep 15)
(with-mutex queue-mutex
@@ -1229,6 +1235,12 @@ References: ~a~%"
(if (procedure? thread-count-parameter)
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name
+ (string-append name " p t ")))
+ (const #t))
+
(lock-mutex pool-mutex)
(while #t
(with-exception-handler