morph: Fix panic when closing morph client #760
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 project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#760
Loading…
Reference in a new issue
No description provided.
Delete branch "acid-ant/frostfs-node:bugfix/749-morph-client-panic"
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?
Close #749
Signed-off-by: Anton Nikiforov an.nikiforov@yadro.com
@ -172,6 +178,8 @@ func (l *listener) listen(ctx context.Context, intError chan<- error) error {
}
func (l *listener) subscribe(errCh chan error) {
l.wg.Add(1)
It it not a goroutine, do we need wg here?
It is routine
6f60884bb4/pkg/morph/event/listener.go (L173)
@ -235,7 +255,7 @@ loop:
if !ok {
l.log.Warn(logs.EventStopEventListenerByNotificationChannel)
if intErr != nil {
May be also move
if intErr != nil
logic in function?The idea was to avoid allocation of error to pass it to the function which should send it. How about to pass string only and allocate error inside the function?
Ah, yeah, missed that.
But the error could easily be moved to a global varable, it is always the same.
6f60884bb4
to84c2453710
@ -213,2 +227,4 @@
}
func (l *listener) sendError(ctx context.Context, intErr chan<- error, err error) bool {
if intErr != nil {
nitpick, mut maybe
if intErr == nil { return false }
and reduce indentation for other code?Agree, updated.
84c2453710
toe74b2cd5c3
e74b2cd5c3
to7217394620