fix(pubsub): handle batch actor shutdown gracefully#4725
Merged
suzmue merged 1 commit intogoogleapis:mainfrom Feb 19, 2026
Merged
fix(pubsub): handle batch actor shutdown gracefully#4725suzmue merged 1 commit intogoogleapis:mainfrom
suzmue merged 1 commit intogoogleapis:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4725 +/- ##
==========================================
+ Coverage 95.06% 95.07% +0.01%
==========================================
Files 198 198
Lines 7598 7598
==========================================
+ Hits 7223 7224 +1
+ Misses 375 374 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PhongChuong
approved these changes
Feb 19, 2026
Collaborator
PhongChuong
left a comment
There was a problem hiding this comment.
Out of curiosity, is there any good way to test this? A quick search did not yield any useful result for testing.
Collaborator
Author
Yeah I was thinking about it and I think if we mock or make an alternative implementation for the BatchActors that just gives up that would work. Will look at adding in a follow up. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During shutdown, tasks may be aborted in any order. This means that we cannot expect that any particular task is alive at a given time. To handle shutdown of the tasks that handle batching, we shut the publisher down completely. Any dropped receiver handles for messages that were not yet sent will receive a ShutdownError when the sender half is dropped.
Shutting down the Dispatcher completely is the cleanest way to handle this and we only expect this to come up when the whole program is shutting down or there is another serious error and we want to stop publishing to indicate that things are not in a good state to continue publishing.
Fixes #4716