Node randomly exits even if Google PubSub subscription is opened
See original GitHub issueProblem description
Node sample app running behind a proxy randomly exits without any close/error event
Reproduction steps
We have a Node app which uses Google PubSub module (2.18.5). Few amount of time per day, we stop receiving messages. We never encounter subscription onClose or onError events. In order to troubleshoot, we wrote a small code to try to reproduce the behavior. We have a similar behavior. Few amount of time per day, the app exits properly without passing through onClose/onError subscription functions. The difference of behavior between our app and the sample code is our app has more stuff to do. That’s why it just stopped receiving messages instead of exiting. We already opened a case to Google PubSub team. They never see disconnections on their side. Our issue is probably a network issue due to the proxy but our concern is we never trigger any onClose/onError events. So, we can’t properly catch them. We verified that onMessage,onClose and onError subscription listeners are still present during process onExit event. We don’t understand why Node exits in our sample code or why we stop receiving message in our app as the subscription streams connections seem to have been re-established. This behavior is completely random.
Environment
- OS name, version and architecture: [e.g. Linux Ubuntu 18.04 amd64] node docker image node:16.14.0-alpine3.15 amd64 running on Kubernetes cluster 1.20
- Node version [e.g. 8.10.0] 16.14.0 LTS
- Node installation method [e.g. nvm] docker image
- If applicable, compiler version [e.g. clang 3.8.0-2ubuntu4]
- Package name and version [e.g. gRPC@1.12.0] @grpc/grpc-js@1.5.5
Additional context
Some interesting logs
call_stream | [705] cancelWithStatus code: 4 details: "Deadline exceeded"
call_stream | [705] close http2 stream with code 8
call_stream | [705] HTTP/2 stream closed with code 8
call_stream | [708] ended with status: code=14 details="Connection dropped"
full log: elastic_result.log code sample: index.js.txt
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:22 (7 by maintainers)
Top GitHub Comments
Hello @levidyrek I’m sorry to hear that but I’m “happy” to know I’m not the only one to have the issue 😄
FWIW, I am also experiencing this issue. The kubernetes container listening on the pubsub subscription randomly restarts with exit code 0 several times a day. The close and error event handlers are not run.