You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 9, 2026. It is now read-only.
We have an high-loaded worker in kubernetes which listens pub/sub queue. Problem is that when pub/sub queue receive several thousands messages worker is stopping processing without any errors (just freezes). Other workers whose processing time is short are working normally but problem worker sometimes could process one message up to several minutes (http requests, database requests) and after processing several hundreds messages logs are stop printing anything.
So to reproduce issue you should have pub/sub subscription with several thousands messages and create python subscriber which will process one message up to 1 minute and longer sometimes.
Regarding longer processing time I specified timeout=60 for future so if processing time taking so long it should throw TimeoutError where I'm calling future.cancel() and here is the problem - cancel() is waiting for graceful shutdown of consuming messages thread and when I did some debugging for it I found out that sometimes cancel() never ends. For instance on server this kind of freeze took 10 days without any logs/errors/etc.
I'm wondering if there way to force future canceling?
Environment details
google-cloud-pubsub1.7.0Problem
We have an high-loaded worker in kubernetes which listens pub/sub queue. Problem is that when pub/sub queue receive several thousands messages worker is stopping processing without any errors (just freezes). Other workers whose processing time is short are working normally but problem worker sometimes could process one message up to several minutes (http requests, database requests) and after processing several hundreds messages logs are stop printing anything.
So to reproduce issue you should have pub/sub subscription with several thousands messages and create python subscriber which will process one message up to 1 minute and longer sometimes.
Regarding longer processing time I specified
timeout=60for future so if processing time taking so long it should throwTimeoutErrorwhere I'm callingfuture.cancel()and here is the problem -cancel()is waiting for graceful shutdown of consuming messages thread and when I did some debugging for it I found out that sometimescancel()never ends. For instance on server this kind of freeze took 10 days without any logs/errors/etc.I'm wondering if there way to force future canceling?
Subscription config
Code example
Thank you for your time!