aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--guix-data-service/poll-git-repository.scm9
-rw-r--r--guix-data-service/web/server.scm19
2 files changed, 28 insertions, 0 deletions
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