Closed webnator closed 1 year ago
Also seeing this on @google-cloud/pub-sub@3.7.3
, although in some cases subscriptions never start to begin with, and no indication (errors emitted) as to why.
Code is also running on Cloud Run (with minimum instance count > 0).
When I listen for debug messages on the subscription, I occasionally see Subscriber stream 4 has ended with status 4; will be retried.
, which feels related.
Check the comment here and see if it helps with any of this: https://github.com/googleapis/nodejs-pubsub/issues/1515#issuecomment-1665969983
I'll forward this on to our grpc-js person to see if he sees anything interesting in the logs.
I was pointed at this as a similar sort of behaviour: https://github.com/grpc/grpc-node/issues/2502
The recommendation is to go ahead and enable keepalives as in https://github.com/googleapis/nodejs-pubsub/issues/1515#issuecomment-1665969983, and see if that helps.
This seems to be solving the issue. It was a bit random so I can't tell for sure, but it was happening every 3-4 hours and now there's been around 24 hours without this issue
Marking this as closed since adding this to the client config seems to solve the issue
const pubsub = new PubSub({
projectId: config.PROJECT_ID,
'grpc.keepalive_timeout_ms': 10000,
'grpc.keepalive_time_ms': 30000,
});
Not pretty but gets the job done
This issue might be related to #979 or #1135
Environment details
@google-cloud/pubsub
version: 3.7.2Steps to reproduce
Also, locally it's created with:
Other details
Code implementation
Code is running in cloud run.
This is how I register a subscription
As you see I'm handling both 'error' and 'close' events but they are never triggered
GRPC logs
By the recommendations in one of the threads, I've enabled the grpc trace logs, and this is what I have.
This is a normal execution of my process
As far as I understand, grpc traces look ok, publishing, then modifying the ack, and then acknowledging. This happens non-stop for hours. Here are only the grpc traces:
Then, all of a sudden, with no external input, these starts to appear
And after that, no more messages are received by the subscription.
I believe this is a bug, and it's related to previous bugs that haven't been solved, or that are reappearing again. Am I doing something wrong? Is there anything I'm missing? Thanks!
Thanks!