node/ir: Handle double SIGHUP correctly #1197

Merged
fyrchik merged 1 commit from elebedeva/frostfs-node:fix/double-sighup into master 2024-06-25 15:20:00 +00:00
Member

Close #1145

Signed-off-by: Ekaterina Lebedeva ekaterina.lebedeva@yadro.com

Close #1145 Signed-off-by: Ekaterina Lebedeva <ekaterina.lebedeva@yadro.com>
elebedeva force-pushed fix/double-sighup from 331434e0ea to 92ee14bd89 2024-06-24 12:25:28 +00:00 Compare
elebedeva requested review from storage-core-committers 2024-06-24 12:42:35 +00:00
elebedeva requested review from storage-core-developers 2024-06-24 12:42:39 +00:00
fyrchik requested changes 2024-06-24 13:11:25 +00:00
@ -76,3 +60,1 @@
shutdown()
log.Info(logs.FrostFSNodeTerminationSignalProcessingIsComplete)
return
case <-ch:
Owner

In your implementation, we now have a race condition between ch and sighupCh.
However, if we received SIGTERM there is no need to SIGHUP, because we will eventually shutdown.
I suggest make SIGTERM/SIGINT having priority over SIGHUP.

In your implementation, we now have a race condition between `ch` and `sighupCh`. However, if we received SIGTERM there is no need to SIGHUP, because we will eventually shutdown. I suggest make SIGTERM/SIGINT having priority over SIGHUP.
Member

Also, there are is no guarantee that we receive all signals, even if we have buffered channel.

Also, there are is no [guarantee](https://github.com/golang/go/blob/b3b4556c245c8f21872910ee866133428bbb5a60/src/os/signal/signal.go#L109) that we receive all signals, even if we have buffered channel.
Owner

Also, there are is no guarantee

It was the problem of the old implementation. Now we have 2 separate channels and SIGTERM / SIGINT are handled similarly, so we should not lose anything useful.

>Also, there are is no guarantee It was the problem of the old implementation. Now we have 2 separate channels and SIGTERM / SIGINT are handled similarly, so we should not lose _anything useful_.
Author
Member

fixed

fixed
elebedeva force-pushed fix/double-sighup from 92ee14bd89 to a0e5fc733e 2024-06-25 09:07:42 +00:00 Compare
fyrchik approved these changes 2024-06-25 09:29:21 +00:00
acid-ant approved these changes 2024-06-25 10:58:20 +00:00
dstepanov-yadro approved these changes 2024-06-25 11:41:34 +00:00
aarifullin approved these changes 2024-06-25 14:05:11 +00:00
fyrchik merged commit a0e5fc733e into master 2024-06-25 15:20:00 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1197
No description provided.