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

Check all usage of context.Background() #4664

Open
yycptt opened this issue Dec 1, 2021 · 1 comment
Open

Check all usage of context.Background() #4664

yycptt opened this issue Dec 1, 2021 · 1 comment
Labels
improvement Incremental improvement for existing features

Comments

@yycptt
Copy link
Contributor

yycptt commented Dec 1, 2021

context.Background() is used in our codebase when making rpc calls, persistence requests, or waiting for some other components. Those usages may be dangerous as they may potentially be blocking and hang for a long time. During service shutdown, we may also get blocked on those places.

It will be good if we can check all usage of context.Background() and see if they make sense or not. And see if we can replace them with a child context that is derived from a root context, which can be cancelled on service shutdown.

A example can be found in this pr: #4662

@ibarrajo ibarrajo added the improvement Incremental improvement for existing features label Nov 1, 2024
@ibarrajo
Copy link
Contributor

ibarrajo commented Nov 1, 2024

Just a quick lookup, there were 271 usages of context.Background() throughout uber/cadence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Incremental improvement for existing features
Projects
None yet
Development

No branches or pull requests

2 participants