Hello,
I'm running a few always connected GUI applications on a server in an x2go session. This usually works fine, especially when I manually disconnect x2goclient after work (I have set X2GO_NXOPTIONS="sleep=0" in x2goagent.options).
But when the x2go connection fails unexpectedly, e.g. because of network issues, or because I suspend my laptop without disconnecting x2go first, my GUI applications get stalled until they disconnect most of the time. After 2 minutes or somesuch they reconnect and keep running. I guess this is because the x2go server session waits for the x2go client to come back, and only disconnects (and keeps running in the disconnected state) after some timeout.
I would like to know if this timeout can be configured somewhere. I would prefer to have to reconnect my client more often, instead of having the mentioned GUI applications reconnect.
Thanks in advance.
Hanno
Hello Hanno,
X11 does not have a reconnect feature for clients. When the X server dies, they die, too. So I am not really sure what you are describing by "reconnect". In case you close your laptop the network connection will go down. The x2goagent will notice after some time that the other side (the laptop) is not answering/sending data anymore and will detect a DISPLAY failure (since the remote X server is not available anymore) and suspend the session.
If you have configured sleep=0 then your applications (meaning Xclients running on the server side, connecting to the x2goagent) will not notice any change as the x2goagent is still there, otherwise they will be slowed down until x2goagent is woken up again by an x2goclient that wants to connect.
I am not aware of an auto connect mechanism once the network is back but on the other hand I am not deeply involved with the internals of x2goclient and/or x2goserver.
Uli
On Mon, Feb 6, 2023 at 5:33 PM Hanno Foest <hurga-x2go@tigress.com> wrote:
Hello,
I'm running a few always connected GUI applications on a server in an x2go session. This usually works fine, especially when I manually disconnect x2goclient after work (I have set X2GO_NXOPTIONS="sleep=0" in x2goagent.options).
But when the x2go connection fails unexpectedly, e.g. because of network issues, or because I suspend my laptop without disconnecting x2go first, my GUI applications get stalled until they disconnect most of the time. After 2 minutes or somesuch they reconnect and keep running. I guess this is because the x2go server session waits for the x2go client to come back, and only disconnects (and keeps running in the disconnected state) after some timeout.
I would like to know if this timeout can be configured somewhere. I would prefer to have to reconnect my client more often, instead of having the mentioned GUI applications reconnect.
Thanks in advance.
Hanno
x2go-user mailing list x2go-user@lists.x2go.org https://lists.x2go.org/listinfo/x2go-user
On Mon, Feb 06, 2023 at 09:18:22PM +0100, Ulrich Sibiller wrote:
In case you close your laptop the network connection will go down. The x2goagent will notice after some time that the other side (the laptop) is not answering/sending data anymore and will detect a DISPLAY failure (since the remote X server is not available anymore) and suspend the session.
If you have configured sleep=0 then your applications (meaning Xclients running on the server side, connecting to the x2goagent) will not notice any change as the x2goagent is still there, otherwise they will be slowed down until x2goagent is woken up again by an x2goclient that wants to connect.
But that's where I notice a difference. If I disconnect the x2go session cleanly, either using the "stop" button or just closing the window, things work as you described. If I don't close the session cleanly, e.g. by just sending the laptop to sleep, or by kill -9 on the x2go client, the remote session stops as if I didn't configure sleep=0.
I'm not entirely sure if it's always the case, but quite often at least, and certainly today when I tested again. And I don't remember that behaviour from years ago, but that's probably just me.
Hanno
On Mon, Feb 6, 2023 at 11:35 PM Hanno Foest <hurga-x2go@tigress.com> wrote:
On Mon, Feb 06, 2023 at 09:18:22PM +0100, Ulrich Sibiller wrote:
In case you close your laptop the network connection will go down. The x2goagent will notice after some time that the other side (the laptop) is not answering/sending data anymore and will detect a DISPLAY failure (since the remote X server is not available anymore) and suspend the session.
If you have configured sleep=0 then your applications (meaning Xclients running on the server side, connecting to the x2goagent) will not notice any change as the x2goagent is still there, otherwise they will be slowed down until x2goagent is woken up again by an x2goclient that wants to connect.
But that's where I notice a difference. If I disconnect the x2go session cleanly, either using the "stop" button or just closing the window, things work as you described. If I don't close the session cleanly, e.g. by just sending the laptop to sleep, or by kill -9 on the x2go client, the remote session stops as if I didn't configure sleep=0.
I'm not entirely sure if it's always the case, but quite often at least, and certainly today when I tested again. And I don't remember that behaviour from years ago, but that's probably just me.
Alright, now I understood. Well, normally both situations should finally end in the same state where sleep is honored.
There are two timeouts you can configure: There's nxagent -timeout (man nxagent) which is described as
-timeout int
auto-disconnect timeout in seconds (minimum allowed:
60). Default is 0 (no timeout).
and there's a timeout option in nxproxy (man nxproxy):
timeout=t Specify the keep-alive timeout used by proxies to determine if there is a network problem preventing communication with the remote peer. A value of 0 disables the check.
Notes:
The latter one seems to be the right one but ATM I don't know if there's a way to set this with/for x2goclient.
But knowing that the proxy code is running on both sides to establish the connection (all that is done in the nxcomp library that exists both on the server and on the client side) it might be simply adding timeout=<value> to X2GO_NXOPTIONS in /etc/x2go/x2goagent.options on the server side in addition to sleep=0.
To get a better overview if it helps I suggest to connect to the server with a separate ssh session and run tail on the session log in /tmp/.x2go-<user>/C.../session.log. You can then see when the connection breaks and when it finally suspends. Check if adding a low timeout changes things here.
Uli