parallel-ssh icon indicating copy to clipboard operation
parallel-ssh copied to clipboard

Cleanup socket on connection error/timeout

Open kurt-cb opened this issue 3 years ago • 0 comments

When constructing a connection to a server, and the server is not responsive, the socket is not closed in a timely fashion and can cause a secondary exception when cleaning up in the exception handler due to the resource leak. This is

ConnectionError: ("Error connecting to host '%s:%s' - %s - retry %s/%s", 'kg-meter2', 22, 'timed out', 3, 3) E
E During handling of the above exception, another exception occurred: E
E Traceback (most recent call last): E File "/home/kgodwin/.local/lib/python3.8/site-packages/_pytest/unraisableexception.py", line 43, in _hook E self.unraisable = unraisable E ResourceWarning: unclosed <socket object, fd=23, family=2, type=1, proto=0>

kurt-cb avatar Jun 16 '22 15:06 kurt-cb