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

use context to correctly close stream connections #368

Merged
merged 2 commits into from
Sep 8, 2023

Conversation

ffalor
Copy link
Collaborator

@ffalor ffalor commented Sep 7, 2023

This PR fixes #363

Currently calling StreamHandle.Close() does not terminate all connections. This PR uses Context to cancel all goroutines when Close is called

This PR also fixes #346

Instead of closing the errors channel in the Close method it is moved to the open method since open is the one writing to the channel it should decide when the channel should be closed.

This PR also removes the the print to stderr and replaces it with adding a error to the errors channel. All closing logic is now called in a defer.

@ffalor ffalor added the bug Something isn't working label Sep 7, 2023
@ffalor ffalor requested a review from carlosmmatos September 7, 2023 21:31
@ffalor ffalor self-assigned this Sep 7, 2023
@ffalor ffalor merged commit 9a96b10 into CrowdStrike:main Sep 8, 2023
@ffalor ffalor deleted the eventstream branch September 8, 2023 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants