8000 Fix shard context error state check by yycptt · Pull Request #2612 · temporalio/temporal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix shard context error state check #2612

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

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

yycptt
Copy link
Member
@yycptt yycptt commented Mar 15, 2022

What changed?

  • Check shard context state inside write lock
  • Remove errorByState()

Why?

  • Currently the state check is done in a separate read lock and the state may change after the read lock is release and before the operation write lock is grabbed.
  • If shard state change to finished (unloaded), s.engine will become nil and we may hit NPE issue can accessing s.engine.

How did you test it?
Existing test, eyeballing

Potential risks

Is hotfix candidate?
Maybe

@yycptt yycptt requested review from dnr and yiminc March 15, 2022 22:41
@yycptt yycptt requested a review from a team as a code owner March 15, 2022 22:41
@yycptt yycptt merged commit 28aebc2 into temporalio:master Mar 16, 2022
@yycptt yycptt deleted the fix-shard-error-state-check branch March 16, 2022 00:17
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
0