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

Get rid of Context.Background()'s #827

Merged
merged 7 commits into from
Dec 15, 2023
Merged

Get rid of Context.Background()'s #827

merged 7 commits into from
Dec 15, 2023

Conversation

peterjan
Copy link
Member

This PR gets rid of (almost) all uses of context.Background().
This should ensure renterd shuts down swiftly, providing a context is passed/used of course.

There are still bg ctxs in the following places:

  • main()
  • migrations
  • tracing
  • miner
  • wallet
  • bus setup

All of those are harmless imo but we could go all out... I also ignored all test files.

@peterjan peterjan self-assigned this Dec 15, 2023
Copy link
Member

@ChrisSchinnerl ChrisSchinnerl left a comment

Choose a reason for hiding this comment

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

Lgtm but can you test this on Arequipa? Just start it, count to 10 and then stop it and see if it shuts down any faster. Might also need to add some error handling to not spam our logs on every shutdown.

worker/contract_lock.go Show resolved Hide resolved
@ChrisSchinnerl ChrisSchinnerl merged commit 93f2f9e into dev Dec 15, 2023
6 checks passed
@ChrisSchinnerl ChrisSchinnerl deleted the pj/shutdown-ctx branch December 15, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants