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 capturing ExecutionContext by timers and background tasks #2129

Merged
merged 3 commits into from
May 17, 2023

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented May 16, 2023

Capturing ExecutionContext can cause a memory leak of async locals values.

restoreFlow = true;
}

_ = Task.Run(ConnectTransportAsync);

Choose a reason for hiding this comment

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

An alternative would be to put an await Task.Yield() at the top of ConnectTransportAsync, or to leave it as-is.
This is fine, too.

@JamesNK JamesNK merged commit f9a00bc into grpc:master May 17, 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