[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/11: Guard against errors when recording job stderr output
From: |
Christopher Baines |
Subject: |
02/11: Guard against errors when recording job stderr output |
Date: |
Fri, 9 Oct 2020 15:21:19 -0400 (EDT) |
cbaines pushed a commit to branch master
in repository data-service.
commit da8586f62d46c72ec55479ef01587eabe434f32a
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Fri Oct 9 19:28:06 2020 +0100
Guard against errors when recording job stderr output
This might help at least handle errors when inserting data in to PostgreSQL.
---
guix-data-service/jobs/load-new-guix-revision.scm | 29 ++++++++++++++++++++---
1 file changed, 26 insertions(+), 3 deletions(-)
diff --git a/guix-data-service/jobs/load-new-guix-revision.scm
b/guix-data-service/jobs/load-new-guix-revision.scm
index 1a29add..de9d4a8 100644
--- a/guix-data-service/jobs/load-new-guix-revision.scm
+++ b/guix-data-service/jobs/load-new-guix-revision.scm
@@ -173,9 +173,32 @@ VALUES (nextval('" (log-part-sequence-name job_id) "'),
$1, $2)")
(let loop ((line (get-line port-to-read-from)))
(let ((line-with-newline
(string-append line "\n")))
- (insert logging-conn job-id line-with-newline)
- (display line-with-newline real-output-port))
- (loop (get-line port-to-read-from)))))))3
+ (catch #t
+ (lambda ()
+ (insert logging-conn job-id line-with-newline)
+ (display line-with-newline real-output-port))
+ (lambda (key . args)
+ (display
+ (simple-format
+ #f
+ "
+error: ~A: ~A
+error: could not insert log part: '~A'\n\n"
+ key args line)
+ real-output-port)
+ (catch #t
+ (lambda ()
+ (insert
+ logging-conn
+ job-id
+ (simple-format
+ #f
+ "
+guix-data-service: error: missing log line: ~A
+\n" key)))
+ (lambda ()
+ #t)))))
+ (loop (get-line port-to-read-from)))))))
port-to-write-to)))
- branch master updated (f1eb2d3 -> 4f3be14), Christopher Baines, 2020/10/09
- 01/11: Guard against derivation IDs that aren't numbers, Christopher Baines, 2020/10/09
- 02/11: Guard against errors when recording job stderr output,
Christopher Baines <=
- 04/11: Change the derivation comparison targets, Christopher Baines, 2020/10/09
- 03/11: Link to the revisions in the comparison header, Christopher Baines, 2020/10/09
- 05/11: Use letpar& for systems and targets in render-compare/derivations, Christopher Baines, 2020/10/09
- 06/11: Clarify that the derivations comparison only is for packages, Christopher Baines, 2020/10/09
- 08/11: Include tablespace as a label for table metrics, Christopher Baines, 2020/10/09
- 09/11: Include the base commit and target commit in the compare output, Christopher Baines, 2020/10/09
- 07/11: Improve select-job-for-commit, Christopher Baines, 2020/10/09
- 10/11: Add Prometheus metrics for indexes specifically, Christopher Baines, 2020/10/09
- 11/11: Split the jobs metric in to succeede, queued and failed, Christopher Baines, 2020/10/09