Xpra: Ticket #2768: Screen off by power settings in windows closes the client

Hello. This happens in windows when the screen goes off because of inactivity as defined in power settings. The client dies immediately, fortunately the state on the server is not lost. To reproduce just turn off screen after 1 minute, wait, when screen off wait for a few more secs. Then log in again and XPRA will no longer be there.

This is my command line in windows:

"C:\Program Files\Xpra\Xpra.exe" attach tcp://172.17.151.234:10000/ --compressor=none

Server: xpra v3.0.9-r26111 Server operating system: Linux marcelo-vm 5.3.0-46-generic #38~18.04.1-Ubuntu SMP Tue Mar 31 04:17:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Client:

Xpra
3.0.9
Python 3.8, 64bit
revision 26113
built on Win7Pro64-PC by Win7 Pro 64
2020-04-13 17:35
using Cython 0.29.16
gcc (Rev2, Built by MSYS2 project) 9.3.0

I will attach a log of the client with "-d all"



Mon, 18 May 2020 12:52:46 GMT - Marcelo Taube:

Had to split the log in two parts, think the second part is the most interesting though


Mon, 18 May 2020 13:06:08 GMT - Antoine Martin: status, description changed; resolution, milestone set

This is not a bug, from your log:

2020-05-18 15:46:09,595 can_retry: <class 'OSError'>, args=(10051, 'A socket operation was attempted to an unreachable network', None, 10051, None), errno=10051, code=10051, abort=10051
2020-05-18 15:46:09,596 tcp socket: 172.17.151.225:50626 <- 172.17.151.234:10000 closed
Traceback (most recent call last):
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 117, in untilConcludes
OSError: [WinError 10051] A socket operation was attempted to an unreachable network
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/protocol.py", line 648, in _io_thread_loop
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/protocol.py", line 727, in _read
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 329, in read
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 199, in _read
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 184, in untilConcludes
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 119, in untilConcludes
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 181, in can_retry
  File "E:\Xpra\tags\v3.0.x\src/xpra/net/bytestreams.py", line 107, in can_retry
xpra.net.common.ConnectionClosedException: [WinError 10051] A socket operation was attempted to an unreachable network

The connection is closed, so the client exits.

The only thing we could do is to add an 'auto-reconnect' option, feel free to create a ticket for that.


Mon, 18 May 2020 14:02:02 GMT - Marcelo Taube:

But why is the connection dying all the time? Are you sure this is completely unrelated to XPRA? (this is a local connection to a virtual machine running on the same computer, unrelated to network access)


Mon, 18 May 2020 14:08:46 GMT - Antoine Martin:

But why is the connection dying all the time?

Is this all the time or just when power settings kick in?

Are you sure this is completely unrelated to XPRA?

Absolutely, the WinError 10051 comes from the OS: Windows Sockets Error Codes: WSAENETUNREACH 10051: Network is unreachable. A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.

this is a local connection to a virtual machine running on the same computer, unrelated to network access

This local connection may still be taken offline when the power saver does its thing.


Sat, 23 Jan 2021 06:00:13 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2768