Dear list members,

We develop a custom client for our application using python-x2go and we make 
use of X2GoRevFwTunnel to expose some client side functionality to the server 
side app.  We observed regular X2Go session freezing after about 3 hours 
running on Windows (several versions, reliably reproducible on Windows 10) with 
the following output:

WARN: Reverse tunnel <paramiko.Channel 16 (open) window=2036405 -> 
<paramiko.Transport at 0x4e4f270L (cipher aes128-ctr, 128 bits) (active; 2 open 
channel(s))>> encoutered socket error: [Errno 10054] An existing connection was 
forcibly closed by the remote host

This message comes from x2go_rev_forward_channel_handler() and if the error 
persists, the code loops endlessly.  This freezes the whole session (IMHO due 
to cooperative multitasking not having a chance to switch).

The attached patch solves the problem by breaking after catching the socket 
error 1024 times.  This leads to the tunnel being closed, which allows the 
application to reopen it automatically and recover gracefully from the  
situation.  This seems suffitiently conservative, seems to make sense generally 
and definitely helps in our case.  Of course, there may be other ways to deal 
with the problem, so the patch is just a suggestion.

We currently work around the problem by monkey patching the function 
x2go_rev_forward_channel_handler(), but of course, we would love to see the 
problem solved upstream.

Thank you for considering the patch and for your great work on the X2Go project.

Best regards

Tomáš Cerha

Attachment: 0001-Prevent-infinite-loop-in-X2GoRevFwTunnel-handler.patch
Description: Binary data


_______________________________________________
x2go-dev mailing list
x2go-dev@lists.x2go.org
https://lists.x2go.org/listinfo/x2go-dev

Reply via email to