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 race condition with eager workflow start and close #1191

Merged

Conversation

Quinn-With-Two-Ns
Copy link
Contributor

Fix race condition in eager WF start reported by roadrunner

https://github.com/roadrunner-server/rr-e2e-tests/actions/runs/5790984816/job/15695006300#step:10:963

removed checking isWorkerStarted because pollerRequestCh will not have any slots if the worker has not started, also moved when the worker is registered to after it is started instead of when it is created.

@Quinn-With-Two-Ns Quinn-With-Two-Ns marked this pull request as ready for review August 8, 2023 19:16
@Quinn-With-Two-Ns Quinn-With-Two-Ns requested a review from a team as a code owner August 8, 2023 19:16
@@ -951,6 +951,9 @@ func (aw *AggregatedWorker) Start() error {
if err := aw.workflowWorker.Start(); err != nil {
return err
}
if aw.client.eagerDispatcher != nil {
Copy link
Member

Choose a reason for hiding this comment

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

What was the reasoning behind this change? (not that I disagree with it)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems inefficient to register workers that had not started yet and force every eager workflow start attempt to try them over and over. Not a huge optimization, but this code path is also for low latency

Copy link
Member

Choose a reason for hiding this comment

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

👍 Just making sure it wasn't fixing something I couldn't see

@Quinn-With-Two-Ns Quinn-With-Two-Ns merged commit 793489f into temporalio:master Aug 8, 2023
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.

2 participants