node: Improve shutdown #930
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#930
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/improve-shutdown"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stop internal activity of the
gc
by context.Release task pool of the
policer
when context cancelled.Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
4ecf408e19
to748b173fc3
@ -339,1 +341,4 @@
return
default:
}
sh.NotificationChannel() <- ev
Shouldn't it be
select
with both this and<-ctx.Done()
branches?A separate
select
forctx.Done()
is ok, because this way we guarantee early exit, though a single select is not much worse.Right, the idea was to exit earlier. And it looks like once
NotificationChannel
is buffered, we can use oneselect
for this too statements.@ -151,0 +150,4 @@
// Currently it is used only for listening for the new epoch event.
// It is ok to keep in buffer one event, it helps us properly react on cancelling of the context.
// In other case we need to keep the order of component shutdown, like closing morph before engine.
eventChan: make(chan Event, 1),
Is it necessary if we implement
select
suggestion from another comment?Yes, because there might be situation when notification received and at the same time context cancelled. In scope of this PR, routine which reading from channel might end earlier than routine which write in it - this will lead to block on write in channel.
Hm, how exactly? If we have select with 2 branches and 1 is available (
ctx.Done()
), there is no way we will blockNo more working from home, messed in your comments. Right, once
select
used for writing ineventChannel
buffering here is redundant.Does
SIGHUP
work correctly?748b173fc3
tof01961bdf9
There are no changes in implementation for reaction on SIGHUP - for
storage engine
we are reconfiguring only shards.f01961bdf9
toba7fa7eca1
ba7fa7eca1
to766ee97e81
766ee97e81
to5f88bf9c77
5f88bf9c77
to1f2c34318f