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 history client NPE for invalid shardID #2679

Merged
merged 1 commit into from Mar 30, 2022

Conversation

yycptt
Copy link
Member

@yycptt yycptt commented Mar 30, 2022

What changed?

  • Fix history client NPE for invalid shardID

Why?

  • Current if shardID is 0, client will not be initialized but still be used to make the rpc call, result in an NPE error.

How did you test it?

  • Tested locally

Potential risks

Is hotfix candidate?

@yycptt yycptt requested a review from yiminc March 30, 2022 05:36
@yycptt yycptt requested a review from a team as a code owner March 30, 2022 05:36
}
opts ...grpc.CallOption,
) (*historyservice.RemoveTaskResponse, error) {
client, err := c.getClientForShardID(request.GetShardId())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getClientForShardID will check if shardID <= 0 and return an invalid argument error.

@yycptt yycptt merged commit b440f92 into temporalio:master Mar 30, 2022
@yycptt yycptt deleted the fix-history-client-npe branch March 30, 2022 06:30
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.

None yet

2 participants