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 data race on desiredWorkflowCacheSize #1377

Merged
merged 1 commit into from
Feb 6, 2024

Conversation

nghiant3223
Copy link
Contributor

@nghiant3223 nghiant3223 commented Feb 3, 2024

What was changed

Add lock/unlock to desiredWorkflowCacheSize in func NewWorkerCache() *WorkerCache.

Why?

Prevent data race.

Checklist

  1. Closes Data race due to missing lock/unlock #1375

  2. How was this tested: Run the test in ticket description to verify.

  1. Any docs updates needed? No

@nghiant3223 nghiant3223 requested a review from a team as a code owner February 3, 2024 10:56
@CLAassistant
Copy link

CLAassistant commented Feb 3, 2024

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Member

@cretz cretz left a comment

Choose a reason for hiding this comment

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

LGTM, will let @Quinn-With-Two-Ns weigh in.

As mentioned on the other PR, if you are hitting this race, it means whatever you're doing is trying to update a cache variable that is already being used in its one spot, so you have bigger problems. Cache size should only be set before everything.

@Quinn-With-Two-Ns
Copy link
Contributor

+1 to everything @cretz said

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 262766c into temporalio:master Feb 6, 2024
12 checks passed
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.

Data race due to missing lock/unlock
4 participants