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: don't leak goroutines if there are no files to watch #822

Merged
merged 1 commit into from
Nov 22, 2024

Conversation

alnr
Copy link
Contributor

@alnr alnr commented Nov 19, 2024

This fixes an issue where we were leaking many goroutines especially during tests, even though there are no files to watch.

Those goroutines are cancelable via the context passed in, but we rarely do that in test code. And if we do, we spawn literally thousands of goroutines before doing one big cancel at the end.

IMO, this whole watching code should either go away or be refactored so it is more obvious that it spawns background goroutines.

@alnr alnr requested a review from zepatrik November 19, 2024 21:57
@alnr alnr self-assigned this Nov 19, 2024
@alnr alnr enabled auto-merge (squash) November 22, 2024 19:20
@alnr alnr force-pushed the alnr/fix-configx-spawn branch from 8dff5c8 to d76a18a Compare November 22, 2024 19:20
@alnr alnr merged commit aebc27e into master Nov 22, 2024
8 checks passed
@alnr alnr deleted the alnr/fix-configx-spawn branch November 22, 2024 19:26
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