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.
Sorry, I accidentally created two bugs when I only wanted one. Please close this and look at bug #5 instead.
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
Dupe of #5 (more details and patch there)
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/4