Skip to content

Conversation

@crimoniv
Copy link
Member

🎩 What?

When shutting down workers, ensure proper termination by waiting until the future is complete (with future.result()).

This should fix a spammy error we're getting on each shutdown:

Observed terminating stream error Cancelled('Locally cancelled by application!')

This started happening in google-cloud-pubsub==2.31.0 (changelog), most probably due to the inclusion of this fix.

🤔 Why?

.result() is expected to be called after .cancel() when shutting down, according to the documentation.

We're already following this approach when safely bootstrapping subscription consumers.

🔗 Related issue

N/A

@crimoniv crimoniv added the bug Something isn't working label Jul 22, 2025
@crimoniv crimoniv merged commit 6d2acc9 into master Jul 22, 2025
5 checks passed
@crimoniv crimoniv deleted the fix-worker-shutdown branch July 22, 2025 14:48
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

Development

Successfully merging this pull request may close these issues.

2 participants