[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/09: Set thread names
From: |
Christopher Baines |
Subject: |
04/09: Set thread names |
Date: |
Wed, 19 Jul 2023 08:37:12 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit 2971322b27247554fb4a7cbff75f68d55e2c3329
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sun Jul 9 19:27:11 2023 +0100
Set thread names
To help with debugging
---
guix-data-service/jobs/load-new-guix-revision.scm | 7 +++++++
guix-data-service/substitutes.scm | 12 ++++++++++++
2 files changed, 19 insertions(+)
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm
b/guix-data-service/jobs/load-new-guix-revision.scm
index 816cbf2..c9408f5 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -36,6 +36,8 @@
#:use-module (guix packages)
#:use-module (guix derivations)
#:use-module (guix build utils)
+ #:use-module ((guix build syscalls)
+ #:select (set-thread-name))
#:use-module (guix-data-service config)
#:use-module (guix-data-service database)
#:use-module (guix-data-service utils)
@@ -170,6 +172,11 @@ VALUES (nextval('" (log-part-sequence-name job_id) "'),
$1, $2)")
(setvbuf port-to-write-to 'line)
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name "inferior logging"))
+ (const #t))
+
(with-postgresql-connection
(simple-format #f "~A inferior error logging" job-id)
(lambda (logging-conn)
diff --git a/guix-data-service/substitutes.scm
b/guix-data-service/substitutes.scm
index 54b4c9e..c7a45dc 100644
--- a/guix-data-service/substitutes.scm
+++ b/guix-data-service/substitutes.scm
@@ -24,6 +24,8 @@
#:use-module (fibers channels)
#:use-module (guix substitutes)
#:use-module (guix narinfo)
+ #:use-module ((guix build syscalls)
+ #:select (set-thread-name))
#:use-module (guix-data-service utils)
#:use-module (guix-data-service database)
#:use-module (guix-data-service model build)
@@ -155,6 +157,11 @@
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name "request substitute query"))
+ (const #t))
+
(while #t
(with-exception-handler
(lambda (exn)
@@ -196,6 +203,11 @@
(call-with-new-thread
(lambda ()
+ (catch 'system-error
+ (lambda ()
+ (set-thread-name "bulk substitute query"))
+ (const #t))
+
(while #t
(with-exception-handler
(lambda (exn)
- branch master updated (672ee62 -> de6d380), Christopher Baines, 2023/07/19
- 06/09: Drop the resource pool timeout, Christopher Baines, 2023/07/19
- 02/09: Support getting resource pool stats, Christopher Baines, 2023/07/19
- 03/09: Expose resource pool stats, Christopher Baines, 2023/07/19
- 05/09: Reduce the number of threads used by fibers, Christopher Baines, 2023/07/19
- 07/09: Make fetching metrics work even when having database problems, Christopher Baines, 2023/07/19
- 01/09: Stop using a pool of threads for database operations, Christopher Baines, 2023/07/19
- 04/09: Set thread names,
Christopher Baines <=
- 08/09: Tweak loading package derivations, Christopher Baines, 2023/07/19
- 09/09: Tweak which duplicate packages to select, Christopher Baines, 2023/07/19