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

Test run: Avoid collector hanging when interrupted via CTRL+C (SIGINT) #563

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

lfittl
Copy link
Member

@lfittl lfittl commented Jul 11, 2024

Due to the way the signal handling is written, we stop checking the testRunSuccess channel once a SIGINT is received. However the code that marks the wait groups as done could only return once it finished writing to the channel, since it was unbuffered. Make the channel buffered so that the code can return as intended.

Fixes #561

Due to the way the signal handling is written, we stop checking the
testRunSuccess channel once a SIGINT is received. However the code
that marks the wait groups as done could only return once it finished
writing to the channel, since it was unbuffered. Make the channel buffered
so that the code can return as intended.

Fixes #561
@lfittl lfittl requested a review from a team July 11, 2024 00:37
Copy link
Contributor

@msakrejda msakrejda left a comment

Choose a reason for hiding this comment

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

A cleaner fix might be to propagate an exit signal to all goroutines (via channel) and use select, but that'd be way more complicated, and this seems robust.

@lfittl lfittl merged commit 687ea5a into main Jul 11, 2024
9 checks passed
@lfittl lfittl deleted the avoid-hanging-test-run-after-sigint branch July 11, 2024 23:18
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.

Can't ctrl-c pganalyze-collector
2 participants