GNU logs - #50007, boring messages


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#50007: 28.0.50; normalize logic surrounding erc-server-reconnecting
Resent-From: "J.P." <jp@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Wed, 11 Aug 2021 14:14:01 +0000
Resent-Message-ID: <handler.50007.B.162869120124739 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: report 50007
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: 50007 <at> debbugs.gnu.org
X-Debbugs-Original-To: bug-gnu-emacs@HIDDEN
Received: via spool by submit <at> debbugs.gnu.org id=B.162869120124739
          (code B ref -1); Wed, 11 Aug 2021 14:14:01 +0000
Received: (at submit) by debbugs.gnu.org; 11 Aug 2021 14:13:21 +0000
Received: from localhost ([127.0.0.1]:36209 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mDoyu-0006Qw-Qt
	for submit <at> debbugs.gnu.org; Wed, 11 Aug 2021 10:13:21 -0400
Received: from lists.gnu.org ([209.51.188.17]:53784)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jp@HIDDEN>) id 1mDoyt-0006Qp-GM
 for submit <at> debbugs.gnu.org; Wed, 11 Aug 2021 10:13:20 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:38552)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1mDoyt-0005uK-Al
 for bug-gnu-emacs@HIDDEN; Wed, 11 Aug 2021 10:13:19 -0400
Received: from mail-108-mta42.mxroute.com ([136.175.108.42]:37243)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jp@HIDDEN>) id 1mDoyr-0001aD-04
 for bug-gnu-emacs@HIDDEN; Wed, 11 Aug 2021 10:13:19 -0400
Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com)
 (Authenticated sender: mN4UYu2MZsgR)
 by mail-108-mta42.mxroute.com (ZoneMTA) with ESMTPSA id 17b358f522400074ba.001
 for <bug-gnu-emacs@HIDDEN>
 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256);
 Wed, 11 Aug 2021 14:13:10 +0000
X-Zone-Loop: f2438ab05fd0da70ac21a221f8e12fc7e9c75df6bd86
X-Originating-IP: [149.28.56.236]
From: "J.P." <jp@HIDDEN>
Date: Wed, 11 Aug 2021 07:12:52 -0700
Message-ID: <87a6lojcij.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-AuthUser: masked@HIDDEN
X-Zone-Spam-Resolution: no action
X-Zone-Spam-Status: No, score=-0.1, required=15, tests=[ARC_NA=0,
 NEURAL_SPAM=0, FROM_HAS_DN=0, HAS_ATTACHMENT=0, FROM_EQ_ENVFROM=0,
 MIME_TRACE=0, MIME_GOOD=-0.1, RCPT_COUNT_ONE=0, MID_RHS_MATCH_FROM=0,
 RCVD_COUNT_ZERO=0, TO_DN_NONE=0]
Received-SPF: pass client-ip=136.175.108.42; envelope-from=jp@HIDDEN;
 helo=mail-108-mta42.mxroute.com
X-Spam_score_int: -18
X-Spam_score: -1.9
X-Spam_bar: -
X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_MSPIKE_H2=-0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

--=-=-=
Content-Type: text/plain

Tags: patch

Knowing when we're reconnecting and having that logic be as sane and
straightforward as possible is (IMO) a critical component of unraveling
the buffer-association game I've been trying to drag everyone into.

The existing approach is troublesome because it's basically inscrutable
in the sense of being too difficult to sit down and reason through once
session identities enter the fray (at least for a simpleton like me).
And though the solution I'm proposing may seem underwhelming, it wasn't
just intuited out of thin air but rather discovered with the backing of
behavioral tests like the ones included in these patches [1]. Thanks.


[1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48598
    https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49860


In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)
 of 2021-08-09 built on localhost
Repository revision: aeec97fae0ccfcc4dc406a5e0e4c0a94b834cac4
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12011000
System Description: Fedora 34 (Workstation Edition)

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
X11 XDBE XIM XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json map text-property-search time-date
subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs
cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils
iso-transl tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock
font-lock syntax font-core term/tty-colors frame minibuffer cl-generic
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 51538 6355)
 (symbols 48 6607 1)
 (strings 32 18255 1368)
 (string-bytes 1 616656)
 (vectors 16 14292)
 (vector-slots 8 185252 10153)
 (floats 8 21 47)
 (intervals 56 205 0)
 (buffers 992 10))

--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Normalize-usage-of-variable-erc-server-reconnecting.patch

From 8ee467d08e00db22309e363aaf1cdd8e3bfe15b5 Mon Sep 17 00:00:00 2001
From: "F. Jason Park" <jp@HIDDEN>
Date: Fri, 11 Jun 2021 03:55:07 -0700
Subject: [PATCH] Normalize usage of variable erc-server-reconnecting

* lisp/erc/erc-backend.el (erc-server-reconnecting-p):
Don't consider erc-server-reconnecting when rendering verdict.
(erc-process-sentinel-2): ensure local variable
erc-server-reconnecting is t when timers are scheduled or running and
trying to reconnect, and nil otherwise, including after no retries
remain. Previously, its use and meaning in erc-backend were convoluted
and conflicted with its use in erc-cmd-RECONNECT.
---
 lisp/erc/erc-backend.el | 37 +++++++++++++++++--------------------
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/lisp/erc/erc-backend.el b/lisp/erc/erc-backend.el
index 6d84665873..1836b7a51c 100644
--- a/lisp/erc/erc-backend.el
+++ b/lisp/erc/erc-backend.el
@@ -197,8 +197,7 @@ erc-server-quitting
   "Non-nil if the user requests a quit.")
 
 (defvar-local erc-server-reconnecting nil
-  "Non-nil if the user requests an explicit reconnect, and the
-current IRC process is still alive.")
+  "Non-nil if reconnecting or scheduled to.")
 
 (defvar-local erc-server-timed-out nil
   "Non-nil if the IRC server failed to respond to a ping.")
@@ -618,36 +617,34 @@ erc-server-filter-function
             (erc-log-irc-protocol line nil)
             (erc-parse-server-response process line)))))))
 
-(define-inline erc-server-reconnect-p (event)
+(defun erc--server-reconnect-p (event)
   "Return non-nil if ERC should attempt to reconnect automatically.
 EVENT is the message received from the closed connection process."
-  (inline-letevals (event)
-    (inline-quote
-     (or erc-server-reconnecting
-         (and erc-server-auto-reconnect
-              (not erc-server-banned)
-              ;; make sure we don't infinitely try to reconnect, unless the
-              ;; user wants that
-              (or (eq erc-server-reconnect-attempts t)
-                  (and (integerp erc-server-reconnect-attempts)
-                       (< erc-server-reconnect-count
-                          erc-server-reconnect-attempts)))
-              (or erc-server-timed-out
-                  (not (string-match "^deleted" ,event)))
-              ;; open-network-stream-nowait error for connection refused
-              (if (string-match "^failed with code 111" ,event) 'nonblocking t))))))
+  (and erc-server-auto-reconnect
+       (not erc-server-banned)
+       ;; make sure we don't infinitely try to reconnect, unless the
+       ;; user wants that
+       (or (eq erc-server-reconnect-attempts t)
+           (and (integerp erc-server-reconnect-attempts)
+                (< erc-server-reconnect-count
+                   erc-server-reconnect-attempts)))
+       (or erc-server-timed-out
+           (not (string-match "^deleted" event)))
+       ;; open-network-stream-nowait error for connection refused
+       (if (string-match "^failed with code 111" event) 'nonblocking t)))
 
 (defun erc-process-sentinel-2 (event buffer)
   "Called when `erc-process-sentinel-1' has detected an unexpected disconnect."
   (if (not (buffer-live-p buffer))
       (erc-update-mode-line)
     (with-current-buffer buffer
-      (let ((reconnect-p (erc-server-reconnect-p event)) message delay)
+      (let ((reconnect-p (erc--server-reconnect-p event)) message delay)
         (setq message (if reconnect-p 'disconnected 'disconnected-noreconnect))
         (erc-display-message nil 'error (current-buffer) message)
         (if (not reconnect-p)
             ;; terminate, do not reconnect
             (progn
+              (setq erc-server-reconnecting nil)
               (erc-display-message nil 'error (current-buffer)
                                    'terminated ?e event)
               ;; Update mode line indicators
@@ -656,7 +653,7 @@ erc-process-sentinel-2
           ;; reconnect
           (condition-case nil
               (progn
-                (setq erc-server-reconnecting   nil
+                (setq erc-server-reconnecting t
                       erc-server-reconnect-count (1+ erc-server-reconnect-count))
                 (setq delay erc-server-reconnect-timeout)
                 (run-at-time delay nil
-- 
2.31.1


--=-=-=--




Message sent:


Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Mailer: MIME-tools 5.505 (Entity 5.505)
Content-Type: text/plain; charset=utf-8
X-Loop: help-debbugs@HIDDEN
From: help-debbugs@HIDDEN (GNU bug Tracking System)
To: "J.P." <jp@HIDDEN>
Subject: bug#50007: Acknowledgement (28.0.50; normalize logic surrounding
 erc-server-reconnecting)
Message-ID: <handler.50007.B.162869120124739.ack <at> debbugs.gnu.org>
References: <87a6lojcij.fsf@HIDDEN>
X-Gnu-PR-Message: ack 50007
X-Gnu-PR-Package: emacs
X-Gnu-PR-Keywords: patch
Reply-To: 50007 <at> debbugs.gnu.org
Date: Wed, 11 Aug 2021 14:14:02 +0000

Thank you for filing a new bug report with debbugs.gnu.org.

This is an automatically generated reply to let you know your message
has been received.

Your message is being forwarded to the package maintainers and other
interested parties for their attention; they will reply in due course.

Your message has been sent to the package maintainer(s):
 bug-gnu-emacs@HIDDEN

If you wish to submit further information on this problem, please
send it to 50007 <at> debbugs.gnu.org.

Please do not send mail to help-debbugs@HIDDEN unless you wish
to report a problem with the Bug-tracking system.

--=20
50007: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D50007
GNU Bug Tracking System
Contact help-debbugs@HIDDEN with problems


Message sent to bug-gnu-emacs@HIDDEN:


X-Loop: help-debbugs@HIDDEN
Subject: bug#50007: 28.0.50; normalize logic surrounding erc-server-reconnecting
Resent-From: Stefan Kangas <stefan@HIDDEN>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@HIDDEN
Resent-Date: Sun, 19 Sep 2021 16:37:03 +0000
Resent-Message-ID: <handler.50007.B50007.163206938218734 <at> debbugs.gnu.org>
Resent-Sender: help-debbugs@HIDDEN
X-GNU-PR-Message: followup 50007
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
To: "J.P." <jp@HIDDEN>
Cc: Amin Bandali <bandali@HIDDEN>, 50007 <at> debbugs.gnu.org
Received: via spool by 50007-submit <at> debbugs.gnu.org id=B50007.163206938218734
          (code B ref 50007); Sun, 19 Sep 2021 16:37:03 +0000
Received: (at 50007) by debbugs.gnu.org; 19 Sep 2021 16:36:22 +0000
Received: from localhost ([127.0.0.1]:39701 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mRznh-0004s6-VF
	for submit <at> debbugs.gnu.org; Sun, 19 Sep 2021 12:36:22 -0400
Received: from mail-pj1-f47.google.com ([209.85.216.47]:53993)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <stefankangas@HIDDEN>) id 1mRzng-0004rj-9t
 for 50007 <at> debbugs.gnu.org; Sun, 19 Sep 2021 12:36:21 -0400
Received: by mail-pj1-f47.google.com with SMTP id j1so10294850pjv.3
 for <50007 <at> debbugs.gnu.org>; Sun, 19 Sep 2021 09:36:20 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20210112;
 h=x-gm-message-state:from:in-reply-to:references:user-agent
 :mime-version:date:message-id:subject:to:cc;
 bh=PJVA5Wgs5TB2Ecc9s8M97j64Ii+JTUFgm+oCC5pMkLY=;
 b=EQrXJnCyUKEMEj3zmynQzj5AcJ5kU5eZuMeA7j2I0bHsfSeykEBkhDzH5WG7a4rfmK
 /09L0toh6FXhwp4aOa/U1ZE3rtQWwGQGZ45AcbHwPGGdDcY2wc0y6XPqhzHVBcrk4tFM
 7jXdsuu8g34qNgsPVHeg2QS8VyuY5UAbGKZyHr7SzONnv/8JWDUW2ns9FgVaM1bI6SwD
 tM4cC+WcZvtVg0RwF/E2txpQaR3l820dbL3fTSrP6JGVE3SXguZXjyYkG0NRyrEBjHMU
 ZaXPoUkOumuiidFRRxRaNrQrNZyxo9WL0+2TKmi0nBnyTxomMTi6FAOdG6wFbHPuGoxE
 3OtA==
X-Gm-Message-State: AOAM530VxgQMVXZC/i3YBK4QRpxhPWeBksZJo3WiO1VKoz9b2B0Guzcf
 IWnycbXjwZt3lyGrBIxrPp10EIC+Kg32cmbrDj9YTDdp
X-Google-Smtp-Source: ABdhPJxZU4TyaONWnjTxk8D4HosqlYWCU5HmDaA4VXKwu9YHJ2+fg/PxrJnuCiDd37bGiQsC/ph+gScILPsIW99TQhM=
X-Received: by 2002:a17:90b:3805:: with SMTP id
 mq5mr32326955pjb.143.1632069374684; 
 Sun, 19 Sep 2021 09:36:14 -0700 (PDT)
Received: from 753933720722 named unknown by gmailapi.google.com with
 HTTPREST; Sun, 19 Sep 2021 09:36:14 -0700
From: Stefan Kangas <stefan@HIDDEN>
In-Reply-To: <87a6lojcij.fsf@HIDDEN> (J. P.'s message of "Wed, 11 Aug
 2021 07:12:52 -0700")
References: <87a6lojcij.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)
MIME-Version: 1.0
Date: Sun, 19 Sep 2021 09:36:14 -0700
Message-ID: <CADwFkmkZ4kbqZqMWmhpprLAP+yGJsYMhgEbXg8PBvgHiR1GZkA@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.5 (/)
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.5 (/)

"J.P." <jp@HIDDEN> writes:

> Tags: patch
>
> Knowing when we're reconnecting and having that logic be as sane and
> straightforward as possible is (IMO) a critical component of unraveling
> the buffer-association game I've been trying to drag everyone into.
>
> The existing approach is troublesome because it's basically inscrutable
> in the sense of being too difficult to sit down and reason through once
> session identities enter the fray (at least for a simpleton like me).
> And though the solution I'm proposing may seem underwhelming, it wasn't
> just intuited out of thin air but rather discovered with the backing of
> behavioral tests like the ones included in these patches [1]. Thanks.
>
>
> [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=48598
>     https://debbugs.gnu.org/cgi/bugreport.cgi?bug=49860

Copying in the ERC maintainer Amin Bandali here.

Amin, could you help review this patch?





Last modified: Sun, 19 Sep 2021 16:45:02 UTC

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