New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Session reestablishment issues #383
Comments
Thanks for reporting this, I was able to reproduce and it's essentially due to this change (grpc/grpc-go#6834) in grpc-go v1.60.0. (gNMIc v0.34.3 uses grpc-go v1.59.0) In short, the change in grpc-go v1.60.0 makes the gRPC client use the OS TCP keepalive defaults instead of the Go stdlib ones. Most linux dist use:
While Go stdlib uses I tested setting the OS TCP keep alive using with the below commands, gNMIc reconnects successfully once the TCP connection is reset and the router is back up. sysctl -w \
net.ipv4.tcp_keepalive_time=15 \
net.ipv4.tcp_keepalive_intvl=15 \
net.ipv4.tcp_keepalive_probes=10 I will have to think a bit about the best way to fix this, ideally I can enable gRPC keepalives by default providing most gNMI servers out there support it. Or use a custom TCP Dialer to avoid grpc-go creating one with the OS defaults. I will keep you posted. |
Alright thanks for the confirmation. Do you know how could I fix this issue with these sysctl rules for the containerised gNMIc version? Or is just the better solution for the time being to use 0.34 version instead? |
Depends how you are running the container, docker run has a
That typically is not allowed with |
v0.36.1 has a default TCP keepalive of 15s, please check it out. |
Quick test shows that the fix works. Thank you for the fix! |
During testing of gNMIc's behavior when the subscription device (router) was turned off, it was noticed that not always a session is reestablished. The behavior regarding session reestablishment differs for different version - for some gNMIc versions, restarting the router causes the gNMIc to stop receiving data, as it does not try establishing a new session. This is an issue for the continuity of the session - router restart should not require to restart gNMIc as well
Below attached see logs showing behavior for different versions. For older 0.34.x version the behavior is correct, but not for the newest 0.36.x
For 0.34.x
And now for 0.36.x the session does not get established after router restarts
The text was updated successfully, but these errors were encountered: