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

Performance optimization for start child workflow task #1397

Merged
merged 2 commits into from Mar 24, 2021

Conversation

wxing1292
Copy link
Contributor

What changed?

  • Release mutable state lock earlier since start child workflow workflow task does not require locking

Why?
RPC call to create the first workflow task of child workflow does not require locking

How did you test it?
Existing tests

Potential risks
N/A

Is hotfix candidate?
No

* Release mutable state lock earlier since start child workflow workflow task does not require locking
@wxing1292 wxing1292 requested review from samarabbas, alexshtin and a team March 23, 2021 18:14
// NOTE: do not access anything related mutable state after this lock release
// release the context lock since we no longer need mutable state builder and
// the rest of logic is making RPC call, which takes time.
release(nil)
Copy link
Member

Choose a reason for hiding this comment

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

It is safe to call release multiply times, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, release function within has an atomic int for status tracking:
https://github.com/temporalio/temporal/blob/v1.8.0/service/history/historyCache.go#L262

@wxing1292 wxing1292 enabled auto-merge (squash) March 24, 2021 18:45
@wxing1292 wxing1292 merged commit bbeab1c into temporalio:master Mar 24, 2021
@wxing1292 wxing1292 deleted the perf-optimize-child-workflow branch March 24, 2021 19:32
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