New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to stop forwarding proposals in consumers after scaling down a stream #4556
Conversation
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
…sals go routine Signed-off-by: Derek Collison <derek@nats.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - How long does test take?
Currently it takes about 40s, I think it can be made shorter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM
server/consumer.go
Outdated
defer o.mu.Unlock() | ||
if o.qch != nil { | ||
close(o.qch) | ||
// Note can not close pch here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this because of a panic when writing to the channel elsewhere?
Signed-off-by: Waldemar Quevedo <wally@synadia.com>
Signed-off-by: Derek Collison <derek@nats.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sometimes when scaling down a stream, a raft node could continue forwarding proposals after already being closed, in the debug logs this can be confirmed by many entries logging
Direct proposal ignored, not leader (state: CLOSED)
.