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(subscription): never try to send on blocked channel when subscription was completed #1100

Merged
merged 10 commits into from
Mar 3, 2025

Conversation

StarpTech
Copy link
Collaborator

@StarpTech StarpTech commented Feb 27, 2025

This PR modifies the approach to synchronizing the shutdown of a subscription. Instead of using a separate channel, it now closes the workChan and terminates the goroutine only after all events have been produced. The final close event will terminate the subscription worker goroutine. The biggest improvement of this change is that closing the channel is done on the same goroutine where subscription are managed. This should eliminate race or deadlock conditions.

@StarpTech StarpTech requested a review from jensneuse February 27, 2025 19:11
@StarpTech StarpTech changed the title fix(subscription): dont block when channel was closed fix(subscription): never try to send on blocked channel when subscription was completed Feb 27, 2025
@StarpTech StarpTech marked this pull request as ready for review March 3, 2025 00:24
@StarpTech StarpTech merged commit 1a1bb20 into master Mar 3, 2025
9 checks passed
@StarpTech StarpTech deleted the dustin/avoid-blocking-send-subs branch March 3, 2025 14:54
StarpTech added a commit that referenced this pull request Mar 3, 2025
🤖 I have created a release *beep* *boop*
---


##
[2.0.0-rc.162](v2.0.0-rc.161...v2.0.0-rc.162)
(2025-03-03)


### Bug Fixes

* **subscription:** never try to send on blocked channel when
subscription was completed
([#1100](#1100))
([1a1bb20](1a1bb20))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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