[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[shepherd] 04/07: service: Removed unnecessary and racy 'handle-terminat
From: |
Ludovic Courtès |
Subject: |
[shepherd] 04/07: service: Removed unnecessary and racy 'handle-termination' messages. |
Date: |
Fri, 24 Mar 2023 13:31:41 -0400 (EDT) |
civodul pushed a commit to branch master
in repository shepherd.
commit e85c160d37e00fa97b4384f16b108506fc13670a
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri Mar 24 14:27:20 2023 +0100
service: Removed unnecessary and racy 'handle-termination' messages.
* modules/shepherd/service.scm (service-controller): Do not send
'notify-termination' message after calling the 'handle-termination'
slot: the 'notify-termination' message could be received *before*
'handle-termination' has run and sent a 'handle-termination' message,
in which case we'd fail to respawn the service.
(stop): Do not send 'notify-termination' message: it is redundant with
the 'stopped-message?' sent once the 'stop' procedure has completed.
---
modules/shepherd/service.scm | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/modules/shepherd/service.scm b/modules/shepherd/service.scm
index cd9bcdd..8d4ccc0 100644
--- a/modules/shepherd/service.scm
+++ b/modules/shepherd/service.scm
@@ -461,8 +461,7 @@ Log abnormal termination reported by @var{status}."
(lambda ()
(false-if-exception
((slot-ref service 'handle-termination)
- service value exit-status))
- (put-message channel 'notify-termination)))
+ service value exit-status))))
(loop (status 'stopped) (value #f) (condition #f)))))
('record-respawn-time ;no reply
@@ -805,10 +804,6 @@ is not already running, and will return SERVICE's
canonical name in a list."
(put-message notification #f)
(caught-error key args))))))
- ;; SERVICE is no longer running.
- (put-message (service-control service)
- 'notify-termination)
-
;; Status message.
(if (running? service)
(local-output (l10n "Service ~a could not be stopped.")
- [shepherd] branch master updated (ae51b5f -> e2d324e), Ludovic Courtès, 2023/03/24
- [shepherd] 03/07: service: Move service process monitoring to service controller., Ludovic Courtès, 2023/03/24
- [shepherd] 04/07: service: Removed unnecessary and racy 'handle-termination' messages.,
Ludovic Courtès <=
- [shepherd] 01/07: service: Remove unused 'make-service-group' macro., Ludovic Courtès, 2023/03/24
- [shepherd] 06/07: service: 'make-systemd-destructor' returns #f once it has closed ports., Ludovic Courtès, 2023/03/24
- [shepherd] 07/07: service: 'stop' no longer prints an extra "has been stopped" message., Ludovic Courtès, 2023/03/24
- [shepherd] 02/07: service: Change protocol for systemd services whose value changes., Ludovic Courtès, 2023/03/24
- [shepherd] 05/07: service: Remove now irrelevant 'conflicts-with' methods., Ludovic Courtès, 2023/03/24