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 write channel to exit when ctx is done #1438

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Conversation

ankur22
Copy link
Collaborator

@ankur22 ankur22 commented Sep 23, 2024

What?

Ensuring that the goroutine can exit early if the context is closed.

Why?

There's a chance that the goroutine reading off the resultCh has or is exiting due to the context being closed. We don't want this goroutine to be hanging around waiting since nothing will read off the resultCh or errCh.

Checklist

  • I have performed a self-review of my code
  • I have added tests for my changes
  • I have commented on my code, particularly in hard-to-understand areas

Related PR(s)/Issue(s)

Updates: #1437

There's a chance that the goroutine reading off the resultCh has or is
exiting due to the context being closed. We don't want this goroutine
to be hanging around waiting since nothing will read off the resultCh.
@ankur22 ankur22 requested a review from inancgumus September 23, 2024 16:08
Copy link
Member

@inancgumus inancgumus left a comment

Choose a reason for hiding this comment

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

👍

@ankur22 ankur22 merged commit 529532e into main Sep 24, 2024
23 checks passed
@ankur22 ankur22 deleted the fix/floating-goroutine branch September 24, 2024 08:45
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