Subject: Re: bug#78920: 30.1; Process sentinel is not called when DNS lookup fails

From: Robert Pluim <[email-masked]>
Date: Mon, 30 Jun 2025 17:20:02 +0200

>>>>> On Mon, 30 Jun 2025 16:36:24 +0300, Eli Zaretskii <[email-masked]> said:
    Eli> Technically, we have no process object in this case; the fact that we
    Eli> create one is an implementation detail.  I'd even go as far as saying
    Eli> that this "process" should not be exposed to Lisp.
    >> 
    >> Then weʼd need to split `make_process' between creating the C-level
    >> process object, and adding that object to `Vprocess_alist' (I hope
    >> that would be enough). And we have to expose it to Lisp in some form,
    >> since `make-network-process' returns a process object.

    Eli> We could give the process a special attribute, and make Lisp APIs skip
    Eli> it.

I think that comes down to the same thing as not adding it to
Vprocess_alist until DNS has succeeded, which is easy to do, Iʼd just
have to make sure it gets added to Vprocess_alist at all the right
spots.

    Eli> But maybe calling the sentinel will be easier and less drastic?  We
    Eli> just need to document that the behavior is not identical to the
    Eli> systems where async DNS resolution is unavailable.

Thereʼs a third DNS failure case I just noticed. With :nowait t we can
get

1. An immediate failure of async DNS
2. A delayed failure of async DNS
3. An immediate failure of sync DNS

In cases 1 and 3 we return an error, in case 2 we set the process
status to "failed". The sentinel is never called.

So calling the sentinel in case 2 changes the behaviour, but that
behaviour was already different, and then it would match what happens
if the remote host exists but eg rejects the connection.

The semantics are not really documented, so I guess we can change them
🙂

Robert
--