all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: 36362@debbugs.gnu.org
Cc: "otadmor ." <otadmor@gmail.com>
Subject: bug#36362: New feature-x-check-server
Date: Thu, 27 Jun 2019 20:34:45 -0400	[thread overview]
Message-ID: <8736ju7dju.fsf@gmail.com> (raw)
In-Reply-To: <CAJd1wG+gtF_Rjp=EXU+77D41j-OD3cpN1uApp98T+Dp3m7pRUg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 82 bytes --]

[forwarding to list, please use "Reply All" to keep 36362@debbugs.gnu.org on Cc]


[-- Attachment #2: Type: message/rfc822, Size: 2850 bytes --]

[-- Attachment #2.1.1: Type: text/plain, Size: 2284 bytes --]

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@gmail.com> wrote:

> "otadmor ." <otadmor@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"...
>
>

  parent reply	other threads:[~2019-06-28  0:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-24 17:05 bug#36362: New feature-x-check-server otadmor .
2019-06-27  9:57 ` bug#36362: Patch for the current 26.2 version otadmor .
2019-06-27 15:10 ` bug#36362: New feature-x-check-server Noam Postavsky
2019-06-28  0:34 ` Noam Postavsky [this message]
2022-02-12  8:18   ` Lars Ingebrigtsen
2022-02-12  9:13     ` otadmor
2022-02-12  9:56       ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-12 10:54         ` otadmor
2022-02-12 11:17           ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2019-06-30 20:41 ` bug#36362: The elisp timer otadmor .
2019-07-30 19:54 ` bug#36362: Tag this report as bug otadmor .
2019-07-31  2:27   ` Eli Zaretskii
2019-07-31  7:01     ` otadmor .
2019-07-31 11:50       ` Noam Postavsky
2019-07-31 17:00         ` otadmor .
2019-07-31 17:18           ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8736ju7dju.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=36362@debbugs.gnu.org \
    --cc=otadmor@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.