guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Ludovic Courtès
Date: Fri, 6 Oct 2023 06:35:09 -0400 (EDT)

branch: master
commit d8de152f76a5496231c23a30d1f8c8f7a4c31ddf
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Oct 6 11:28:55 2023 +0200

    notification: Call ‘send-email’ in a separate thread.
    
    This fixes a bug whereby the POSIX thread running the notification fiber
    would be stuck in waitpid(2) while waiting for the mailer invoked by
    ‘mu-message-send’ to complete.
    
    * src/cuirass/notification.scm (spawn-notification-fiber): Wrap
    ‘send-email*’ call in ‘non-blocking’.
---
 src/cuirass/notification.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/cuirass/notification.scm b/src/cuirass/notification.scm
index 1123b6b..a21db8e 100644
--- a/src/cuirass/notification.scm
+++ b/src/cuirass/notification.scm
@@ -165,7 +165,10 @@ the detailed information about this build here: ~a."
                      notif build)
           (cond
            ((email? notif)
-            (send-email* notif build))
+            ;; 'send-email' calls 'mu-message-send', which in turn spawns a
+            ;; mailer process and blocks until completion with waitpid(2).  Do
+            ;; that in a separate thread to avoid blocking all the fibers.
+            (non-blocking (send-email* notif build)))
            ((mastodon? notif)
             (send-mastodon build))))
          (#f #f))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]