GNU bug report logs - #53814
process-status returns invalid/undocumented status file-error for network process

Previous Next

Package: emacs;

Reported by: emacsq <laszlomail <at> protonmail.com>

Date: Sun, 6 Feb 2022 07:27:02 UTC

Severity: normal

Fixed in version 29.1

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53814 in the body.
You can then email your comments to 53814 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53814; Package emacs. (Sun, 06 Feb 2022 07:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to emacsq <laszlomail <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 06 Feb 2022 07:27:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: emacsq <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: process-status returns invalid/undocumented status file-error for
 network process
Date: Sun, 06 Feb 2022 07:26:00 +0000
M-x list-process shows some network processes with the
status file-error.

According to the docs this is not a valid return
value for process-status:

Return the status of PROCESS.

The returned value is one of the following symbols:
run  -- for a process that is running.
stop -- for a process stopped but continuable.
exit -- for a process that has exited.
signal -- for a process that has got a fatal signal.
open -- for a network stream connection that is open.
listen -- for a network stream server that is listening.
closed -- for a network stream connection that is closed.
connect -- when waiting for a non-blocking connection to complete.
failed -- when a non-blocking connection has failed.
nil -- if arg is a process name and no such process exists.
PROCESS may be a process, a buffer, the name of a process, or
nil, indicating the current buffer's process.


Apparently, process.c does set this this invalid status for some
reason:

  Lisp_Object data = get_file_errno_data (err, contact, xerrno);

  pset_status (p, list2 (Fcar (data), Fcdr (data)));
  unbind_to (count, Qnil);
  return;


https://github.com/emacs-mirror/emacs/blob/3af9e84ff59811734dcbb5d55e04e1fdb7051e77/src/process.c#L3642




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53814; Package emacs. (Sun, 06 Feb 2022 10:45:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: emacsq <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Re: process-status returns invalid/undocumented status file-error for
 network process
Date: Sun, 06 Feb 2022 10:44:05 +0000
>
> Apparently, process.c does set this this invalid status for some
> reason:
>
>   Lisp_Object data = get_file_errno_data (err, contact, xerrno);
>   pset_status (p, list2 (Fcar (data), Fcdr (data)));
>   unbind_to (count, Qnil);
>   return;
>

So process.c sets the status to file-error, and it also has
error message obtained via get_file_errno_data.

I checked what it says for such a process:

("make client process failed" "Too many open files" :name "example.com" ...)

So I guess it's a too many open connections error, but instead of
saying that, it sets the status to the undocumented file-error.

What's strange is when I delete such a 'file-error' process from
the process list, then it immediately goes to connect and then open
state for the given domain, which is not clear for me how it is
possible, since delete-process removes the process from the list
of processes.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53814; Package emacs. (Sun, 06 Feb 2022 12:33:02 GMT) Full text and rfc822 format available.

Message #11 received at submit <at> debbugs.gnu.org (full text, mbox):

From: emacsq <laszlomail <at> protonmail.com>
To: "Bug reports for GNU Emacs,
 the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
Subject: Re: process-status returns invalid/undocumented status file-error for
 network process
Date: Sun, 06 Feb 2022 12:32:22 +0000
> So I guess it's a too many open connections error, but instead of
> saying that, it sets the status to the undocumented file-error.

I found a relevant commit from 2018 by Lars, and its commit says:

src/process.c (connect_network_socket): When an async :family
'local client fails (with a file error, for instance), mark the
process as failed.

https://github.com/emacs-mirror/emacs/commit/92ba34d89ac4f5b5bbb818e1c39a3cc12a405790#diff-18c8f6291e2c6a6f88223e509421492528e624157da1ba063401a6ffc36e63b6L3595

Does failed here mean the Qfailed status? Then why is status set to
to the car of file error returned by get_file_errno_data  which
returns file-error or some other file related bug?

Somebody who was part of this discussion then may be able to shed
some light on it.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53814; Package emacs. (Sun, 06 Feb 2022 23:28:02 GMT) Full text and rfc822 format available.

Message #14 received at 53814 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: emacsq <laszlomail <at> protonmail.com>
Cc: 53814 <at> debbugs.gnu.org
Subject: Re: bug#53814: process-status returns invalid/undocumented status
 file-error for network process
Date: Mon, 07 Feb 2022 00:26:53 +0100
emacsq <laszlomail <at> protonmail.com> writes:

> src/process.c (connect_network_socket): When an async :family
> 'local client fails (with a file error, for instance), mark the
> process as failed.

I've now fixed this in Emacs 29.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53814; Package emacs. (Sun, 06 Feb 2022 23:28:02 GMT) Full text and rfc822 format available.

Message #17 received at 53814 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: emacsq <laszlomail <at> protonmail.com>
Cc: 53814 <at> debbugs.gnu.org
Subject: Re: bug#53814: process-status returns invalid/undocumented status
 file-error for network process
Date: Mon, 07 Feb 2022 00:27:43 +0100
emacsq <laszlomail <at> protonmail.com> writes:

> What's strange is when I delete such a 'file-error' process from
> the process list, then it immediately goes to connect and then open
> state for the given domain, which is not clear for me how it is
> possible, since delete-process removes the process from the list
> of processes.

Presumably something is waiting for the connection to complete, and then
reconnects when it is?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug marked as fixed in version 29.1, send any further explanations to 53814 <at> debbugs.gnu.org and emacsq <laszlomail <at> protonmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 06 Feb 2022 23:29:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53814; Package emacs. (Mon, 07 Feb 2022 06:40:02 GMT) Full text and rfc822 format available.

Message #22 received at 53814 <at> debbugs.gnu.org (full text, mbox):

From: emacsq <laszlomail <at> protonmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53814 <at> debbugs.gnu.org
Subject: Re: bug#53814: process-status returns invalid/undocumented status
 file-error for network process
Date: Mon, 07 Feb 2022 06:39:36 +0000
>
> > What's strange is when I delete such a 'file-error' process from
> > the process list, then it immediately goes to connect and then open
> > state for the given domain, which is not clear for me how it is
> > possible, since delete-process removes the process from the list
> > of processes.
>
> Presumably something is waiting for the connection to complete, and  reconnects when it is?

Apparently, url-http has some kind of a retry mechanism,
so when the failed process is deleted then the process sentinel
restarts the connection.

Which does not feel entirely right, because if I delete the process
explicitly then the process sentinel should be deactivated,
instead of being called and letting it restart the connection.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 07 Mar 2022 12:24:05 GMT) Full text and rfc822 format available.

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

Previous Next


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