This article provides resolution for whenever gRPC sessions get stuck on CLOSED state.
When the issue happens, FD leak in JSD process can be observed. The issue can be tracked with the help of the command show system connections which will show the FDs associated with collectors as CLOSED for a long time even after the collectors are disconnected with error.
For example:
user@device> show system connections inet6 | match 1016
tcp6 0 108239 <IPv6 Address>.10162 <IPv6 Address>.50142 ESTABLISHED
tcp6 0 100392 <IPv6 Address>.10162 <IPv6 Address>.50140 ESTABLISHED
tcp6 0 116328 <IPv6 Address>.10162 <IPv6 Address>.50138 ESTABLISHED
tcp6 0 1168 <IPv6 Address>.10162 <IPv6 Address>.50128 LAST_ACK
tcp6 0 161 <IPv6 Address>.10162 <IPv6 Address>.50130 LAST_ACK
tcp6 0 0 <IPv6 Address>.10162 <IPv6 Address>.50120 CLOSED
tcp6 0 126 <IPv6 Address>.10162 <IPv6 Address>.50110 LAST_ACK
tcp6 0 0 <IPv6 Address>.10162 <IPv6 Address>.50014 ESTABLISHED
tcp6 0 0 <IPv6 Address>.10162 <IPv6 Address>.49764 CLOSED
tcp46 0 0 *.10162
On all platforms supporting JET and Telemetry, some gRPC sessions are hanging in CLOSED state as per detailed in the public PR1571999 . The same supplied the following resolved-in versions:
https://prsearch.juniper.net/problemreport/PR1571999