Subject: Re: bug#50166: 28.0.50; ECM for possible process-status/sentinel bug

From: Adam Porter <[email-masked]>
Date: Sun, 22 Aug 2021 20:31:08 -0500

On Sun, Aug 22, 2021 at 5:40 PM Lars Ingebrigtsen <[email-masked]> wrote:
>
> Lars Ingebrigtsen <[email-masked]> writes:
>
> > Without that :stderr in make-process, I see no peculiarities here.
>
> So I suspect that this is working as intended?  But the :stderr entry in
> the doc string should mention this...

Thanks for investigating that, Lars.

I guess it would be a good thing if this turned out to be just a
documentation issue.  But if it is, I'm left to wonder what the right
way is to capture the STDERR of a (make-process) process while also
waiting on all of the process's associated processes to exit, have
their output collected into the designated buffers, and their
sentinels run.  The manual says to use (while (accept-process-output
PROCESS)), but apparently that may return while a process's :stderr
process is still running, or something like that...  (The fact that
"process" seems to have some extra meanings in the context--it refers
not only to the program called with `make-process'--seems to add to
the difficulty of reasoning and communicating about these issues.)

As an aside, I tried removing the :stderr argument to make-process in
my plz.el library, but unfortunately it did not help the problem I'm
observing there: that running ERT tests in series, with curl processes
started in quick succession (though only one at a time) leads to
failing tests, apparently related to sentinels not being called after
a process's output has been collected (and running the tests
individually almost always succeeds).  So I don't know if the problem
described in this report is related to that, or whether it's a bug in
my code, my understanding, or a different process-related issue in
Emacs.  It "feels like" they could be loosely related, but what do I
know.  :)