GNU bug report logs -
#54062
29.0.50; [PATCH] Eshell should inform processes when a pipe is broken
Previous Next
Reported by: Jim Porter <jporterbugs <at> gmail.com>
Date: Sat, 19 Feb 2022 04:21:01 UTC
Severity: normal
Tags: patch
Found in version 29.0.50
Fixed in version 29.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
Message #43 received at 54062 <at> debbugs.gnu.org (full text, mbox):
On 2/22/2022 5:09 AM, Eli Zaretskii wrote:
>> Cc: 54062 <at> debbugs.gnu.org
>> From: Jim Porter <jporterbugs <at> gmail.com>
>> Date: Mon, 21 Feb 2022 12:37:59 -0800
>>
>> Attached is a patch that ignores the `eshell-pipe-broken' error in
>> `eshell-sentinel'. It's not really an error in that case anyway, since
>> we only want to write the last bit of output *if we can*.
>
> Thanks, this fixes the test. However, I'm unsure we should fix this
> inside eshell-sentinel: do we always want to ignore "broken pipe"
> errors in Eshell subprocesses, and never show them to the user?
I think we do want to ignore that error here. In `eshell-sentinel', we
only run the `finish-io' code when the subprocess's state has already
changed; in this case, that means the subprocess has already been
terminated, since Eshell doesn't handle cases like SIGSTOP or SIGCONT
yet (see the commented out functions at the bottom of
lisp/eshell/esh-proc.el). Normally, if we detect a broken pipe, we'd
want to signal the subprocess that tried to write, but since we know
it's already been terminated, there's no (living) process to signal anymore.
It would be good to support cases like SIGSTOP/SIGCONT in the future,
but `eshell-sentinel' already fails to account for that, so this patch
doesn't make things worse in that regard. For example, this function
always calls `eshell-remove-process-entry', whose docstring says:
Record the process ENTRY as fully completed.
That's definitely not right for a process being continued with SIGCONT,
and probably isn't right for SIGSTOP either.
This bug report was last modified 3 years and 146 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.