* bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons
@ 2015-10-05 8:58 Paul Pogonyshev
2015-10-05 9:25 ` Eli Zaretskii
2016-06-14 21:51 ` Noam Postavsky
0 siblings, 2 replies; 4+ messages in thread
From: Paul Pogonyshev @ 2015-10-05 8:58 UTC (permalink / raw)
To: 21617
[-- Attachment #1: Type: text/plain, Size: 1383 bytes --]
This can be reproduced with Gradle, but you don't need a Gradle project for
this. When running from a normal console:
$ gradle
Starting a new Gradle Daemon for this build (subsequent builds will be
faster).
:help
...
Total time: 2.014 secs
Now if I repeat it, the daemon is reused, so the first message is gone and
the "build" goes much faster:
$ gradle
:help
...
Total time: 0.495 secs
By comparison, when run from Emacs M-x compile, Gradle starts daemon every
time, so all builds look like the first example above. However, if daemon
already exists (e.g. created by console run above), it will not be killed.
File '~/.gradle/daemon/VERSION/daemon-PID.out.log' for daemons spawned
after M-x compile ends with this line:
Daemon vm is shutting down... The daemon has exited normally or was
terminated in response to a user interrupt.
When daemon is allowed to exist (e.g. when run from a normal console), log
receives this message instead:
... Daemon is idle, sleeping until state change or idle timeout at ...
Additionally, I checked several other ways to run process from Emacs:
* M-x eshell: daemon is killed, as with M-x compile
* M-x shell: daemon works properly
* M-!: daemon works properly
So, it seems that Emacs has a way to keep daemons alive / not kill them,
but it is not used in compilation mode.
Paul
[-- Attachment #2: Type: text/html, Size: 2023 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons
2015-10-05 8:58 bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons Paul Pogonyshev
@ 2015-10-05 9:25 ` Eli Zaretskii
2015-10-05 9:43 ` Paul Pogonyshev
2016-06-14 21:51 ` Noam Postavsky
1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2015-10-05 9:25 UTC (permalink / raw)
To: Paul Pogonyshev; +Cc: 21617
> Date: Mon, 5 Oct 2015 10:58:33 +0200
> From: Paul Pogonyshev <pogonyshev@gmail.com>
>
> By comparison, when run from Emacs M-x compile, Gradle starts daemon every
> time, so all builds look like the first example above. However, if daemon
> already exists (e.g. created by console run above), it will not be killed.
>
> File '~/.gradle/daemon/VERSION/daemon-PID.out.log' for daemons spawned after
> M-x compile ends with this line:
>
> Daemon vm is shutting down... The daemon has exited normally or was terminated
> in response to a user interrupt.
>
> When daemon is allowed to exist (e.g. when run from a normal console), log
> receives this message instead:
>
> ... Daemon is idle, sleeping until state change or idle timeout at ...
>
> Additionally, I checked several other ways to run process from Emacs:
>
> * M-x eshell: daemon is killed, as with M-x compile
> * M-x shell: daemon works properly
> * M-!: daemon works properly
>
> So, it seems that Emacs has a way to keep daemons alive / not kill them, but it
> is not used in compilation mode.
I just tried
M-x compile RET C-a C-k emacs -Q -daemon RET
and that started a daemon which stayed up in the air and didn't exit
or get killed. If you see the same on your system, then Gradle,
whatever that is, is indeed somehow involved in this, because without
it everything works as you expected.
Also, you didn't tell which version of Emacs you used (I used the
latest development sources).
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons
2015-10-05 9:25 ` Eli Zaretskii
@ 2015-10-05 9:43 ` Paul Pogonyshev
0 siblings, 0 replies; 4+ messages in thread
From: Paul Pogonyshev @ 2015-10-05 9:43 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 21617
[-- Attachment #1: Type: text/plain, Size: 921 bytes --]
> I just tried
>
> M-x compile RET C-a C-k emacs -Q -daemon RET
>
> and that started a daemon which stayed up in the air and didn't exit
> or get killed.
Yeah, it also works here. I can only guess that Gradle daemon is terminated
if
stdout is closed before the main process is shut down or something like
that.
> If you see the same on your system, then Gradle,
> whatever that is, is indeed somehow involved in this, because without
> it everything works as you expected.
It's a pretty standard build tool (Make of sorts) in a Java world. They
will of
course tell me (for the second time, I already asked for support for this
problem
before) it's an Emacs' fault, because outside it Gradle works fine.
> Also, you didn't tell which version of Emacs you used (I used the
> latest development sources).
GNU Emacs 25.0.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of
2015-08-27,
a fairly recent trunk.
Paul
[-- Attachment #2: Type: text/html, Size: 1193 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons
2015-10-05 8:58 bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons Paul Pogonyshev
2015-10-05 9:25 ` Eli Zaretskii
@ 2016-06-14 21:51 ` Noam Postavsky
1 sibling, 0 replies; 4+ messages in thread
From: Noam Postavsky @ 2016-06-14 21:51 UTC (permalink / raw)
To: 21617; +Cc: Paul Pogonyshev
This sounds like http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21866
and http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16019, Emacs sends
SIGHUP to all children of pty subprocesses. The "user interrupt"
mentioned above could be the SIGHUP.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-06-14 21:51 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-05 8:58 bug#21617: Emacs compilation mode prevents child processes from spawning/forking daemons Paul Pogonyshev
2015-10-05 9:25 ` Eli Zaretskii
2015-10-05 9:43 ` Paul Pogonyshev
2016-06-14 21:51 ` Noam Postavsky
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).