You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I observed a large number of TCP connections in the ESTABLISHED state. It appears that the method may not be properly closing connections after the request is completed, causing connections to remain open and accumulate over time.
Should we explicitly call con.disconnect() to ensure connections are properly closed after use?
tcp6 0 0 172.25.148.212:42058 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:53202 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:4161 172.25.148.212:57892 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:43808 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:52334 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:4161 172.25.148.212:56484 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:4161 172.25.148.212:52334 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:51564 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:36432 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:4161 172.25.148.212:50028 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:46972 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:59220 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:36368 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:49010 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:45846 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:55636 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:52328 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:55424 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:37510 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:4161 172.25.148.212:59684 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:4161 172.25.148.212:51920 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:4161 172.25.148.212:45644 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:4161 172.25.148.212:40490 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:4161 172.25.148.212:51912 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:46706 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:51912 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:35188 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:58828 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:4161 172.25.148.212:42174 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:59814 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:47186 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:56956 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:51920 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:48244 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:44146 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:53786 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:41250 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:34934 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:50028 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:58136 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:49852 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:4161 172.25.148.212:47186 ESTABLISHED 986/nsqlookupd
tcp6 0 0 172.25.148.212:44186 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:39392 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:54300 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:59604 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:57280 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:59292 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:41762 172.25.148.212:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:50108 172.25.148.213:4161 ESTABLISHED 3888/java
tcp6 0 0 172.25.148.212:57480 172.25.148.213:4161 ESTABLISHED 3888/java
The text was updated successfully, but these errors were encountered:
if (con.getResponseCode() != 200) {
logger.debug("ignoring lookup resp:{} nsqlookupd:{} topic:{}", con.getResponseCode(), lookup, topic);
continue;
}
in = newBufferedReader(newInputStreamReader(con.getInputStream()));
finally {
Util.closeQuietly(in);
}
Even though closing the InputStream typically triggers HttpURLConnection to automatically close the connection, in the case where the response code is non-200 (i.e., a failure response), the InputStream is not read, and thus the connection is not automatically closed. In such scenarios, the connection remains open unless explicitly disconnected.
Should we explicitly call con.disconnect() in cases where the response code is not 200, or is there another recommended way to ensure the connection is properly closed?
I observed a large number of TCP connections in the ESTABLISHED state. It appears that the method may not be properly closing connections after the request is completed, causing connections to remain open and accumulate over time.
Should we explicitly call
con.disconnect()
to ensure connections are properly closed after use?The text was updated successfully, but these errors were encountered: