Skip to content
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

Merged

Conversation

pdoerner
Copy link
Contributor

@pdoerner pdoerner commented Jan 24, 2023

What changed?

Added a RWLock to wait for in-progress Add calls and prevent new Add 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.

@pdoerner pdoerner requested a review from a team as a code owner January 24, 2023 18:33
@yycptt yycptt requested a review from alexshtin January 26, 2023 01:03
Comment on lines 189 to 191
errFuture := future.NewFuture[bool]()
errFuture.Set(false, errVisibilityShutdown)
return errFuture
Copy link
Member

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

@pdoerner pdoerner merged commit de0b049 into temporalio:master Feb 1, 2023
@pdoerner pdoerner deleted the fix-visibility-processor-panic-shutdown branch February 1, 2023 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants