From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mike Kazantsev Newsgroups: gmane.emacs.bugs Subject: bug#31901: Incorrect make-network-process + nowait state handling for non-existing unix sockets in emacs-26.1 Date: Sun, 22 Jul 2018 21:42:07 +0500 Message-ID: <20180722214207.1ccaff3d@malediction> References: <20180619104351.41e4e3d1@malediction> <87efgnm17h.fsf@gmail.com> <831scgn3ig.fsf@gnu.org> <83in5ib53q.fsf@gnu.org> <83muum1d3m.fsf@gnu.org> <83effy14p6.fsf@gnu.org> <20180722195458.2e40086f@malediction> <83pnzfw9g0.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1532277673 32114 195.159.176.226 (22 Jul 2018 16:41:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 22 Jul 2018 16:41:13 +0000 (UTC) Cc: Lars Ingebrigtsen , npostavs@gmail.com, 31901@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 22 18:41:08 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhHPv-0008Dk-1P for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jul 2018 18:41:07 +0200 Original-Received: from localhost ([::1]:56715 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhHS1-0006ud-ID for geb-bug-gnu-emacs@m.gmane.org; Sun, 22 Jul 2018 12:43:17 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhHRp-0006uF-Ng for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 12:43:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhHRm-00012i-4v for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 12:43:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:47638) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhHRm-00012Y-0y for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 12:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fhHRl-00088c-Kq for bug-gnu-emacs@gnu.org; Sun, 22 Jul 2018 12:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mike Kazantsev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Jul 2018 16:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 31901 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 31901-submit@debbugs.gnu.org id=B31901.153227774431232 (code B ref 31901); Sun, 22 Jul 2018 16:43:01 +0000 Original-Received: (at 31901) by debbugs.gnu.org; 22 Jul 2018 16:42:24 +0000 Original-Received: from localhost ([127.0.0.1]:52656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhHR6-00087c-MQ for submit@debbugs.gnu.org; Sun, 22 Jul 2018 12:42:24 -0400 Original-Received: from mail-lf1-f53.google.com ([209.85.167.53]:33679) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhHR1-00087L-VL for 31901@debbugs.gnu.org; Sun, 22 Jul 2018 12:42:19 -0400 Original-Received: by mail-lf1-f53.google.com with SMTP id u14-v6so4801913lfu.0 for <31901@debbugs.gnu.org>; Sun, 22 Jul 2018 09:42:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ehNaZchy/JpY+LUgTqbIdy7PyBJdHhLSJfJeF+RmILs=; b=bdA0BbhE3N2RN7L92u5pNt+Gedv0NRFcq0p9GpMT+bIuYA4DkFjv/afHJrqgxjWiif ZxZc/z74oj9Q0GdB+HYdC+XJrPPzidp92WexAiIGIHD79xQY2c6vota0ScDssj7IWZDH QSmy2caDAs5lq6l//WLZhStDhyZ45PTMd4eslIxqRNTNfBx5w0OGnI/IXIzDsSmLYM8d beVnyiwQaYXdqllj74Hhly759MqJL4ulWl0Z9rxfjdEvmskcb2xhXNDZPU1ezssOCrPQ rGWnN9+aXmhXEiJFdHQUzW+FIyvXH1FK44YYdGbqmzAus4qtmEs3jw+rIROzQIlcR8Mc 5Peg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ehNaZchy/JpY+LUgTqbIdy7PyBJdHhLSJfJeF+RmILs=; b=qd5MH7AB9HGFAodrEzFNwYw2ceJxVS6y5EeloWaE0fu8XHm61GwR2PEontS/bJsVZE 02SM1of3+p7oicJQ31KVbu9AjPbtGP/IKS+ue9/7K1hbEKUZ99brPSCT96aK7FQ2WKFu lp3xcy4xBe71lM7MQA7q39NbJbGAGF0BwFROjVw1HZQTSPdLypiIKU9HTYfwG/L86zox qA1/2zOXY0VNpBncGGb+/eIyu4YiNn88b1G+PL1a2Ps9LoyamcnwHWFJIQdJ83k+w6+x yDu3G+FsrAwDQfnUth5KHrjeM6ByrfEpDMSfq4vKAigxMDQiUUlD7x4+dtsNXRFm0lCg NNPQ== X-Gm-Message-State: AOUpUlGhxENrFWX2XxB6HWX8PJW8UoHIJGNEytoaVs300ovB/KBhnKIE aCuW4/otAD2jOblrDDLnx9A= X-Google-Smtp-Source: AAOMgpfhrm2+OL3RGsnmzunWqQxwMrYnqJ7SHqe8Sn2t2XaMAhpFvUpIMUPzWNP3zqCjfdWeMWoY9w== X-Received: by 2002:a19:e546:: with SMTP id c67-v6mr5352665lfh.135.1532277730128; Sun, 22 Jul 2018 09:42:10 -0700 (PDT) Original-Received: from malediction ([46.48.96.28]) by smtp.gmail.com with ESMTPSA id m8-v6sm1434909ljj.10.2018.07.22.09.42.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 22 Jul 2018 09:42:09 -0700 (PDT) In-Reply-To: <83pnzfw9g0.fsf@gnu.org> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148824 Archived-At: On Sun, 22 Jul 2018 18:56:31 +0300 Eli Zaretskii wrote: > > From: Lars Ingebrigtsen > > Cc: Eli Zaretskii , npostavs@gmail.com, 31901@debbugs.gnu.org > > Date: Sun, 22 Jul 2018 17:23:45 +0200 > > > > Mike Kazantsev writes: > > > > > Given either of these guidelines, it'd be more surprising to not get > > > error state in the sentinel call with ":nowait t" in emacs-26. > > > > I agree, it would be better to get a sentinel callback. But I don't > > think that's how it's ever worked, so that's not a regression. But it > > could be a new feature for Emacs 27... > > Yes, I think we should just fix the bug on emacs-26, and introduce the > sentinel callback on master. I just built emacs from git to test how it works, and have to report that unfortunately current behavior is not consistent with what emacs had either before this bug was introduced. More details follow. == How it worked in emacs-25: (make-network-process ... :family 'local :service "/tmp/does-not-exist.sock" :nowait t :sentinel #'unix-socket-test-func) => nil [sentinel never called] (process-live-p socket) => nil (because "socket" will be nil) (process-status socket) => error I.e. nil was returned to indicate failure to create network process. == How it works in emacs-26.1 (with the bug in question): (make-network-process ... :family 'local :service "/tmp/does-not-exist.sock" :nowait t :sentinel #'unix-socket-test-func) => # [sentinel never called] (process-live-p socket) => [non-nil value] (process-status socket) => 'open This is the case described in the original bug report. == How it works in emacs-26.1 with ":nowail nil": (make-network-process ... :family 'local :service "/tmp/does-not-exist.sock" :nowait nil :sentinel #'unix-socket-test-func) => [file-missing signaled] [sentinel never called] (process-live-p socket) => [no socket value] (process-status socket) => [no socket value] Provided here to illustrate the difference with current ":nowait t" case. == How it works in current emacs-git [8f3bca3ad51]: (make-network-process ... :family 'local :service "/tmp/does-not-exist.sock" :nowait t :sentinel #'unix-socket-test-func) => # [sentinel never called] (process-live-p socket) => nil (process-status socket) => 'file-missing Note that this is: - Not consistent with what emacs did before this bug. - Not consistent with what emacs-26 does with ":nowait nil". - Does not seem to be consistent with what documentation describes (as indicated in this thread earlier, might be subjective). So wanted to note that as it is, entirely new unexpected behavior was introduced, which does not line up neither with how this worked previously (and will certainly break the code there), nor how you'd expect it to work after emacs-26 changes (either signal error same as ":nowait nil" does, or via sentinel). As far as I can tell, this applies to both missing unix socket and when it exists, but connection to it is refused (nothing listening there). -- Mike Kazantsev // fraggod.net