nats-io / stan.java

NATS Streaming Java Client
https://nats.io
Apache License 2.0
93 stars 36 forks source link

restarting nats streaming server client connections dont recover #157

Open tanzeelrana opened 3 years ago

tanzeelrana commented 3 years ago

On a fresh install when things are working fine we can see 7 clients and 12 channels(subscriptions)

Screen Shot 2020-10-29 at 4 49 27 PM

Screen Shot 2020-10-29 at 4 49 34 PM

After we restart the nats-streaming-server service these counts drop and some channels and client connections are unable to recover.

Screen Shot 2020-10-29 at 4 50 55 PM Screen Shot 2020-10-29 at 4 51 26 PM

I added a connectionListener on all streaming connections to debug further, looking at the debug logs it looks like we get a disconnect -> connect -> resubscribed events in order when i restart the nats streaming server.

Screen Shot 2020-10-27 at 9 35 22 PM

Observing the connection events being fired on a nats streaming server restart it looks like all client connections and subscriptions have recovered successfully but that is not the case as we have seen from the nats streaming server metrics and also grafana metrics.

I am using nats java stan library https://github.com/nats-io/stan.java

Does anyone know why my clients and subscriptions never come back even though the connection events say that everything is connected and resubscribed ?

fxnn commented 3 years ago

Seems to be the same as #118