GNU bug report logs - #36362
New feature-x-check-server

Previous Next

Package: emacs;

Reported by: "otadmor ." <otadmor <at> gmail.com>

Date: Mon, 24 Jun 2019 17:08:01 UTC

Severity: wishlist

Tags: wontfix

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Noam Postavsky <npostavs <at> gmail.com>
To: 36362 <at> debbugs.gnu.org
Cc: "otadmor ." <otadmor <at> gmail.com>
Subject: bug#36362: New feature-x-check-server
Date: Thu, 27 Jun 2019 20:34:45 -0400
[Message part 1 (text/plain, inline)]
[forwarding to list, please use "Reply All" to keep 36362 <at> debbugs.gnu.org on Cc]

[Message part 2 (message/rfc822, inline)]
From: "otadmor ." <otadmor <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Subject: Re: bug#36362: New feature-x-check-server
Date: Thu, 27 Jun 2019 22:12:56 +0300
[Message part 3 (text/plain, inline)]
I have some non consistency of the terms client and server. Some refer to
the emacs client/daemon, some refer to the xserver, emacs as x11 client.

Hi,
I have this scenerio:
1. Laptop with Windows 10 host and Ubuntu 1804 vm.putty and xming (latest
versions) are installed on host and emacs 26.2 on the vm.
2. Connect with putty via sshx to the vm and run emacsclient -c. Doest
really matter how emacs deamon is started (with the ex, via the ssh as
emacs -daemon, directly in the vm, as sysctl -user start emacs).
3. Close the laptop lid so it goes to sleep.
4. Open the lid and reconnect with sshx and emacs client -c.
5. The second emacs client causes emacs daemon to stuck on xcb select (they
have no timeout). The emacs client is still running correctly before the
second emacs client.

The propose is to have this connectivity check native function + timer
which executes it on all existing frames every few seconds.

This native function closes the fd of the xcb and causes the select to
return EINTR. xcb have internal infinate loop Incase of EINTR, so closing
the fd is necessary to get out of this infinite loop. Closing the fd also
causes libx11 to realize the connection was closed and call the error
handler of emacs for x11 failures for a clean termination of the resources
in emacs.

This native function is consist of a a native timer with a signal handler
to handle when this timer expires. I have set the native timer for 0.5
seconds and it is configurable using an elisp variable. When the server was
not disconnected this timer don't expires, doesnt close the fd and returned
immediately without waiting 0.5 seconds. When the client crashed because of
sleep, the native code will have to wait before realizing it. I have
selected GetGeomerty arbitrarly. This is usually used by emacs and I don't
believe it has an extra side effect. The xcb knows the sequence numbers of
the requests and should not be confused with other GetGeomerty/other
non-GetGeomerty requests.

Shalom.

On Thu, Jun 27, 2019, 18:10 Noam Postavsky <npostavs <at> gmail.com> wrote:

> "otadmor ." <otadmor <at> gmail.com> writes:
>
> > A new native method to check connectivity of xserver.
>
> Can you explain a bit when/why this is useful?  As it stands this patch
> is rather "apropos of nothing"...
>
>

This bug report was last modified 3 years and 101 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.