Xpra: Ticket #4: windows stay visible on the screen even if the server is killed

Currently if the server is killed the _to_server thread exits and closes both _client_conn and _server_conn. However, this does not cause the _to_client thread to stop. As a result an extra "xpra" process stays listed in the process list and users don't notice that the server has died. Only if you try to interactive with any of the windows will the proxy write something to the server socket and notice the problem.

This patch stops _to_client thread when _to_server thread exits and vice versa. Calling _Thread_stop() is bit ugly but the alternative would probably be to use some sort of polling mechanism instead of blocking read() in _copy_loop.



Tue, 05 Jul 2011 07:59:13 GMT - Timo Juhani Lindfors:

Sorry, I accidentally created two bugs when I only wanted one. Please close this and look at bug #5 instead.


Tue, 05 Jul 2011 08:12:36 GMT - Timo Juhani Lindfors:

If you click a window when the server has died you get

 Exception in thread Thread-2:
 Traceback (most recent call last):
   File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
     self.run()
   File "/usr/lib/python2.6/threading.py", line 484, in run
      self.__target(*self.__args, **self.__kwargs)
   File "/usr/lib/python2.6/dist-packages/xpra/proxy.py", line 28, in _to_server_loop
     self._copy_loop("->server", self._client_conn, self._server_conn)
    File "/usr/lib/python2.6/dist-packages/xpra/proxy.py", line 40, in _copy_loop
     buf = buf[to_conn.write(buf):]
   File "/usr/lib/python2.6/dist-packages/xpra/protocol.py", line 50, in write
     return self._s.send(buf)
   File "/usr/lib/python2.6/socket.py", line 167, in _dummy
      raise error(EBADF, 'Bad file descriptor')
 error: [Errno 9] Bad file descriptor
 Connection lost
 Error reading from connection: I/O operation on closed file

After this patch you get

Connection lost

immediately when the server dies


Tue, 05 Jul 2011 19:09:52 GMT - Antoine Martin: status changed; resolution set

Dupe of #5 (more details and patch there)


Mon, 20 Feb 2012 19:53:20 GMT - Antoine Martin: version, milestone set


Sat, 23 Jan 2021 04:42:58 GMT - migration script:

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