-
Notifications
You must be signed in to change notification settings - Fork 911
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 visibility processor panic on add after stop #3830
Fix visibility processor panic on add after stop #3830
Conversation
common/persistence/visibility/store/elasticsearch/processor_test.go
Outdated
Show resolved
Hide resolved
common/persistence/visibility/store/elasticsearch/processor_test.go
Outdated
Show resolved
Hide resolved
errFuture := future.NewFuture[bool]() | ||
errFuture.Set(false, errVisibilityShutdown) | ||
return errFuture |
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.
nit: now we can reuse the future in newFuture
and avoid allocating a new channel.
Not related to your PR but it seems like the assignment on L202 will cause the underlying channel in newFuture
not getting closed. I am not sure if golang GC can handle this case or result in some leak. cc @alexshtin
What changed?
Added a RWLock to wait for in-progress
Add
calls and prevent newAdd
calls before shutting down.Any add requests after the processor has been stopped are dropped and a warn-level message is logged.
Why?
Bug fix.
How did you test it?
New unit test.
Potential risks
No risks.
Is hotfix candidate?
No.