Bug 8283 - ResourceWarning in client log if XML-RPC handler fails
Summary: ResourceWarning in client log if XML-RPC handler fails
Status: NEW
Alias: None
Product: ThinLinc
Classification: Unclassified
Component: Client (show other bugs)
Version: trunk
Hardware: PC Unknown
: P2 Normal
Target Milestone: LowPrio
Assignee: Bugzilla mail exporter
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-05 10:21 CET by Adam Halim
Modified: 2024-01-09 13:06 CET (History)
0 users

See Also:
Acceptance Criteria:


Attachments

Description Adam Halim cendio 2024-01-05 10:21:16 CET
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.
Comment 1 Pierre Ossman cendio 2024-01-08 10:21:20 CET
We should probably also report something back to the client, rather than just dropping everything.

Note You need to log in before you can comment on or make changes to this bug.