nats.py
nats.py copied to clipboard
ping/pong is not working
Observed behavior
After connection stablished, if connection goes stale ping/pong is not being executed.
after my debug i found:
_process_connect_init()
is defining ping_interval_task and it process error for stale connections but task it self is never being called. (at least I could not find it.)
EXTRA: this issue could be related.
Expected behavior
stale connection being processed allowing developer catch it. logs here
Server and client version
nats 2.10 (alpine image).
Host environment
macos m1
Steps to reproduce
- start nats server
- connect to server
- wait 10s
- stop server
- you can wait on client and is not ping/poing ing.
Thanks for raising the issue, the ping interval is working which you can confirm reducing the ping interval to be lower for example:
nc = await nats.connect("nats://127.0.0.1:4222",
error_cb=_error_cb,
ping_interval=2,
I did confirm that the error callback is not reporting the type of disconnection so will fix that.