Created attachment 1175 [details] Fix ResourceWarning if XML-RPC error occurs Came across a ResourceWarning that I could only reproduce on a Windows client. I made 'get_capabilities' crash deliberately on the server, which gave the following in tlclient.log: > 2024-01-05T10:08:20: Calling XML-RPC method 'get_capabilities' > 2024-01-05T10:08:26: Call to XML-RPC method 'get_capabilities' failed > 2024-01-05T10:08:26: ssh[E]: THINLINC-LOGIN: ERROR: Unexpected EOF while reading HTTP message > 2024-01-05T10:08:26: ssh[E]: sys:1: ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_UNIX, type=SocketKind.SOCK_STREAM, proto=0, laddr=b'\x000005f', raddr=/var/run/thinlinc/master/1000> > 2024-01-05T10:08:26: ssh[E]: > 2024-01-05T10:08:26: ssh[E]: COMMAND_EXITSTATUS: 2 > 2024-01-05T10:08:26: WinProcess: Process 18284 (ssh.exe) did not exit in a timely manner. Forcing termination... Connecting to the same server from a linux or mac client gives the following instead: > 2024-01-05T10:10:41: Calling XML-RPC method 'get_capabilities' > 2024-01-05T10:10:41: Call to XML-RPC method 'get_capabilities' failed > 2024-01-05T10:10:42: ServiceProcess: select error (Bad file descriptor) for service ssh > 2024-01-05T10:10:42: Process 1817067 exited with code 0 I'm not sure why this only happens on Windows, but I noticed that we forget to close a socket in thinlinc-login if a crash happens. I've attached a patch which seems to fix this issue, but I haven't looked into if this can occur elsewhere as well.
We should probably also report something back to the client, rather than just dropping everything.