Open theobouwman opened 1 month ago
nats-py provides us with a connection recovery functional, but seems like recovery doesn't work if Authentication was failed. Also, it looks like Authentication fails on connection timeout too... I need to dig into nats-py to find the reason
Authentication error are not occurring anymore. We use Cloud Run with min instance 1. So a started instance could run for days, only when we push new a new container will be created. But we noticed that when we push no updates for a day or 1, 2 or 3 we get error like connection closed
could there be a setting to automatically reconnect after a certain period?
Describe the bug Our FastStream NATS implementation has seen a lot of error, since the start of using it:
How to reproduce Our NATSService, used by our regular FastAPI app:
And here is is our Dishka setup for the NATS Worker service which will handle NATS messages, the broker is used by the NATSService and the router by the FastAPI FastStream implementation:
And lastly the Worker App:
Expected behavior We expect our NATSService and FastStream app to have constant connection with the NATS server (hosted on Scaleway), without the errors, and to automatically reconnect which is default behaviour.
Observed behavior We observe connection errors, so does this suggest that the broker is not reconnecting?:
Environment
Additional context We have contacted Scaleway support. They stated that resource limits are:
Which is more than enough, and we are not exceeding this.
They also stated that we must be sure to handle automatic reconnection. But to our understanding this is the default behaviour.
so are we doing something totally wrong with our implementation? We are not always getting these errors. They seem to appear irregular.