[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: Set the names of more threads
From: |
Christopher Baines |
Subject: |
branch master updated: Set the names of more threads |
Date: |
Thu, 16 Nov 2023 06:30:43 -0500 |
This is an automated email from the git hooks/post-receive script.
cbaines pushed a commit to branch master
in repository data-service.
The following commit(s) were added to refs/heads/master by this push:
new de211ef Set the names of more threads
de211ef is described below
commit de211ef5eafecba49a34eae7e6da6db78f198bf8
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Thu Nov 16 11:30:23 2023 +0000
Set the names of more threads
To help with debugging.
---
guix-data-service/poll-git-repository.scm | 9 +++++++++
guix-data-service/web/server.scm | 19 +++++++++++++++++++
2 files changed, 28 insertions(+)
diff --git a/guix-data-service/poll-git-repository.scm
b/guix-data-service/poll-git-repository.scm
index e059343..124c559 100644
--- a/guix-data-service/poll-git-repository.scm
+++ b/guix-data-service/poll-git-repository.scm
@@ -25,6 +25,8 @@
#:use-module (git)
#:use-module (guix git)
#:use-module (guix channels)
+ #:use-module ((guix build syscalls)
+ #:select (set-thread-name))
#:use-module (guix-data-service database)
#:use-module (guix-data-service model git-repository)
#:use-module (guix-data-service model git-branch)
@@ -35,6 +37,13 @@
(define (start-thread-to-poll-git-repository git-repository-id)
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name
+ (simple-format #f "poll git ~A"
+ git-repository-id)))
+ (const #t))
+
(libgit2-init!)
(honor-system-x509-certificates!)
diff --git a/guix-data-service/web/server.scm b/guix-data-service/web/server.scm
index 6b855cc..7acfb2b 100644
--- a/guix-data-service/web/server.scm
+++ b/guix-data-service/web/server.scm
@@ -26,7 +26,10 @@
#:use-module (system repl error-handling)
#:use-module (ice-9 atomic)
#:use-module (fibers)
+ #:use-module (fibers scheduler)
#:use-module (fibers conditions)
+ #:use-module ((guix build syscalls)
+ #:select (set-thread-name))
#:use-module (prometheus)
#:use-module (guix-data-service utils)
#:use-module (guix-data-service database)
@@ -75,6 +78,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))
+
(parameterize
((connection-pool
(make-resource-pool
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: Set the names of more threads,
Christopher Baines <=