GNU bug report logs - #5650
23.1; ERC causes Emacs to hang on network dropouts

Previous Next

Package: emacs;

Reported by: Richard Lewis <richardlewis <at> fastmail.co.uk>

Date: Thu, 25 Feb 2010 21:59:01 UTC

Severity: normal

Tags: fixed, patch

Fixed in version 26.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 5650 in the body.
You can then email your comments to 5650 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 owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Thu, 25 Feb 2010 21:59:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Richard Lewis <richardlewis <at> fastmail.co.uk>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Feb 2010 21:59:02 GMT) Full text and rfc822 format available.

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

From: Richard Lewis <richardlewis <at> fastmail.co.uk>
To: bug-gnu-emacs <at> gnu.org
Subject: 23.1; ERC causes Emacs to hang on network dropouts
Date: Thu, 25 Feb 2010 21:57:49 +0000
When my network connection drops out, ERC loses its connection and
attempts to reconnect. I see the message "connecting to server
irc.freenode.net 6777..." in the minibuffer and Emacs becomes
unresponsive.

netstat tells me that the Emacs process has a TCP socket in the
SYN_SENT state to freenode.net.

I found today that, if left for a long time (not sure how long, but <
2 hours [which was the amount of time I left my computer unattended]
and > ~10 minutes [which was the amount of time I fiddled with it last
time it happened]), it evetually gives up and Emacs becomes responsive
again.

In GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.18.2)
 of 2010-01-27 on raven, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.10705000
configured using `configure  '--build=i486-linux-gnu' '--host=i486-linux-gnu' '--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib' '--localstatedir=/var/lib' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--with-pop=yes' '--enable-locallisppath=/etc/emacs23:/etc/emacs:/usr/local/share/emacs/23.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/23.1/site-lisp:/usr/share/emacs/site-lisp:/usr/share/emacs/23.1/leim' '--with-x=yes' '--with-x-toolkit=gtk' '--with-toolkit-scroll-bars' 'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu' 'CFLAGS=-DDEBIAN -g -O2' 'LDFLAGS=-g' 'CPPFLAGS=''

Important settings:
  value of $LC_ALL: en_GB.UTF-8
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: en_GB.UTF-8
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default-enable-multibyte-characters: t

Major mode: Org

Minor modes in effect:
  erc-list-mode: t
  erc-menu-mode: t
  erc-autojoin-mode: t
  erc-ring-mode: t
  erc-networks-mode: t
  erc-pcomplete-mode: t
  erc-track-mode: t
  erc-track-minor-mode: t
  erc-match-mode: t
  erc-button-mode: t
  erc-fill-mode: t
  erc-stamp-mode: t
  erc-netsplit-mode: t
  diff-auto-refine-mode: t
  display-time-mode: t
  display-battery-mode: t
  jabber-activity-mode: t
  jabber-mode-line-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  show-paren-mode: t
  delete-selection-mode: t
  iswitchb-mode: t
  shell-dirtrack-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  global-auto-composition-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
Making thread...done
Updating marks...
Scoring...done
Updated (-0/+1) message(s).
Updated (-0/+1) message(s)
Retrieving...done
Disposing messages...done
ERC Version 5.3
Mark set
Making completion list...





bug reassigned from package 'emacs' to 'emacs,erc'. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 26 Feb 2010 21:36:01 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs,erc. (Fri, 26 Feb 2010 23:51:01 GMT) Full text and rfc822 format available.

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

From: Vivek Dasmohapatra <vivek <at> etla.org>
To: 5650 <at> debbugs.gnu.org
Subject: Proposed fix
Date: Fri, 26 Feb 2010 23:49:50 +0000 (GMT)
[Message part 1 (text/plain, inline)]
Does this patch fix things for you?
[0001-Make-the-default-erc-connection-method-non-blocking.patch (text/x-diff, attachment)]

Added tag(s) patch. Request was from Vivek Dasmohapatra <vivek <at> etla.org> to control <at> debbugs.gnu.org. (Fri, 26 Feb 2010 23:52:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs,erc. (Thu, 04 Mar 2010 13:59:01 GMT) Full text and rfc822 format available.

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

From: Vivek Dasmohapatra <vivek <at> collabora.co.uk>
To: 5650 <at> debbugs.gnu.org
Subject: Oops, bad patch.
Date: Thu, 4 Mar 2010 13:58:18 +0000 (GMT)
The patch is a little broken - would have fixed it earlier but mu HD
exploded and I've been resurrecting my laptop from backups.

Will fix shortly.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs,erc. (Mon, 08 Mar 2010 23:32:02 GMT) Full text and rfc822 format available.

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

From: Vivek Dasmohapatra <vivek <at> etla.org>
To: 5650 <at> debbugs.gnu.org
Subject: updated patch
Date: Mon, 8 Mar 2010 23:29:35 +0000 (GMT)
[Message part 1 (text/plain, inline)]
Updated patch, currently in use on my machine, byte compiles cleanly this 
time and appears to as expected.
[0001-Make-an-async-connection-in-attempt-by-default-in-er.patch (text/x-diff, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Sun, 25 Apr 2010 20:43:02 GMT) Full text and rfc822 format available.

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

From: Thomas Riccardi <riccardi.thomas <at> gmail.com>
To: 5650 <at> debbugs.gnu.org
Subject: Issue with the patch
Date: Sun, 25 Apr 2010 22:39:14 +0200
[Message part 1 (text/plain, inline)]
The patch works for me (even if there is still a small freeze during
about 1 second at the connection if the server doesn't answer), but
creates an issue with the auto reconnect feature.

It happens when the server doesn't answer the connection request (tested
with a DROP on packets coming from it with iptables).

The patch makes the function erc-server-connect to return even if the
connection is not ready. Then erc-open and erc-server-reconnect do the
same.

Finally, in erc-process-sentinel-2, there is no error executing
erc-server-reconnect, thus erc-server-reconnect-count is never
incremented and is even reset.

I made a patch that increments erc-server-reconnect-count before calling
erc-server-reconnect instead, and resets it only when the connection is
really ready, that is, in erc-connection-established.
[Fix-reconnect-attempts-count.patch (text/x-patch, attachment)]

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Sat, 14 Aug 2010 23:06:02 GMT) Full text and rfc822 format available.

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

From: Chong Yidong <cyd <at> stupidchicken.com>
To: Giorgos Keramidas <keramida <at> ceid.upatras.gr>,
	ERC Discussion <erc-discuss <at> gnu.org>
Cc: 5650 <at> debbugs.gnu.org, Vivek Dasmohapatra <vivek <at> etla.org>,
	Thomas Riccardi <riccardi.thomas <at> gmail.com>
Subject: Re: 23.1; ERC causes Emacs to hang on network dropouts
Date: Sat, 14 Aug 2010 19:05:56 -0400
[Message part 1 (text/plain, inline)]
> > When my network connection drops out, ERC loses its connection and
> > attempts to reconnect. I see the message "connecting to server
> > irc.freenode.net 6777..." in the minibuffer and Emacs becomes
> > unresponsive.
> ...
> I made a patch that increments erc-server-reconnect-count before calling
> erc-server-reconnect instead, and resets it only when the connection is
> really ready, that is, in erc-connection-established.

Hi,

Could someone please review this patch by Thomas Riccardi and Vivek
Dasmohapatra?  The full description of the problem can be viewed at

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=5650

Thanks.

[Fix-reconnect-attempts-count.patch (text/x-diff, inline)]
diff --git a/.emacs.d/erc-5.3/erc-backend.el b/.emacs.d/erc-5.3/erc-backend.el
index 70ce789..928770e 100644
--- a/.emacs.d/erc-5.3/erc-backend.el
+++ b/.emacs.d/erc-5.3/erc-backend.el
@@ -618,13 +618,11 @@ EVENT is the message received from the closed connection process."
           (condition-case err
               (progn
                 (setq erc-server-reconnecting nil)
-                (erc-server-reconnect)
-                (setq erc-server-reconnect-count 0))
+                (setq erc-server-reconnect-count (1+ erc-server-reconnect-count))
+                (erc-server-reconnect))
             (error (when (buffer-live-p buffer)
                      (set-buffer buffer)
-                     (if (integerp erc-server-reconnect-attempts)
-                         (setq erc-server-reconnect-count
-                               (1+ erc-server-reconnect-count))
+                     (unless (integerp erc-server-reconnect-attempts)
                        (message "%s ... %s"
                                 "Reconnecting until we succeed"
                                 "kill the ERC server buffer to stop"))
diff --git a/.emacs.d/erc-5.3/erc.el b/.emacs.d/erc-5.3/erc.el
index 9aa5e8b..802ae66 100644
--- a/.emacs.d/erc-5.3/erc.el
+++ b/.emacs.d/erc-5.3/erc.el
@@ -4267,6 +4267,7 @@ Set user modes and run `erc-after-connect' hook."
 	    (nick (car (erc-response.command-args parsed)))
 	    (buffer (process-buffer proc)))
 	(setq erc-server-connected t)
+	(setq erc-server-reconnect-count 0)
 	(erc-update-mode-line)
 	(erc-set-initial-user-mode nick buffer)
 	(erc-server-setup-periodical-ping buffer)

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Wed, 06 Feb 2013 00:08:02 GMT) Full text and rfc822 format available.

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

From: Michael McCracken <michael.mccracken <at> gmail.com>
To: 5650 <at> debbugs.gnu.org
Subject: Status
Date: Tue, 5 Feb 2013 16:06:13 -0800
[Message part 1 (text/plain, inline)]
Hi, I have been experiencing this issue, and am currently testing out the
patches in this thread. I was wondering if there's anything I can do to
help move this along, as it's a big problem for anyone with a flaky IRC
connection.
[Message part 2 (text/html, inline)]

Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2015 22:18:01 GMT) Full text and rfc822 format available.

bug marked as fixed in version 25.2, send any further explanations to 5650 <at> debbugs.gnu.org and Richard Lewis <richardlewis <at> fastmail.co.uk> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sun, 27 Dec 2015 22:18:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Sun, 27 Dec 2015 22:32:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Thomas Riccardi <riccardi.thomas <at> gmail.com>
Cc: 5650 <at> debbugs.gnu.org
Subject: Re: bug#5650: Issue with the patch
Date: Sun, 27 Dec 2015 23:17:23 +0100
Thomas Riccardi <riccardi.thomas <at> gmail.com> writes:

> The patch works for me (even if there is still a small freeze during
> about 1 second at the connection if the server doesn't answer), but
> creates an issue with the auto reconnect feature.
>
> It happens when the server doesn't answer the connection request (tested
> with a DROP on packets coming from it with iptables).
>
> The patch makes the function erc-server-connect to return even if the
> connection is not ready. Then erc-open and erc-server-reconnect do the
> same.
>
> Finally, in erc-process-sentinel-2, there is no error executing
> erc-server-reconnect, thus erc-server-reconnect-count is never
> incremented and is even reset.
>
> I made a patch that increments erc-server-reconnect-count before calling
> erc-server-reconnect instead, and resets it only when the connection is
> really ready, that is, in erc-connection-established.
>

Thanks; applied to the Emacs trunk.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Sun, 27 Dec 2015 22:32:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Vivek Dasmohapatra <vivek <at> etla.org>
Cc: 5650 <at> debbugs.gnu.org
Subject: Re: bug#5650: updated patch
Date: Sun, 27 Dec 2015 23:17:11 +0100
Vivek Dasmohapatra <vivek <at> etla.org> writes:

> Updated patch, currently in use on my machine, byte compiles cleanly
> this time and appears to as expected.

Thanks; applied to the Emacs trunk.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#5650; Package emacs. (Sun, 27 Dec 2015 22:33:03 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Giorgos Keramidas <keramida <at> ceid.upatras.gr>,
 ERC Discussion <erc-discuss <at> gnu.org>, 5650 <at> debbugs.gnu.org,
 Vivek Dasmohapatra <vivek <at> etla.org>,
 Thomas Riccardi <riccardi.thomas <at> gmail.com>
Subject: Re: bug#5650: 23.1; ERC causes Emacs to hang on network dropouts
Date: Sun, 27 Dec 2015 23:16:56 +0100
Chong Yidong <cyd <at> stupidchicken.com> writes:

>> > When my network connection drops out, ERC loses its connection and
>> > attempts to reconnect. I see the message "connecting to server
>> > irc.freenode.net 6777..." in the minibuffer and Emacs becomes
>> > unresponsive.
>> ...
>> I made a patch that increments erc-server-reconnect-count before calling
>> erc-server-reconnect instead, and resets it only when the connection is
>> really ready, that is, in erc-connection-established.
>
> Hi,
>
> Could someone please review this patch by Thomas Riccardi and Vivek
> Dasmohapatra?  The full description of the problem can be viewed at

The patches looked OK to me.  I've applied them to the Emacs trunk
now -- I think we can consider this "new functionality" and not a bug
fix.  It seems to work for me, but I guess time will tell..

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




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

bug unarchived. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:02 GMT) Full text and rfc822 format available.

bug Marked as fixed in versions 26.1. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:02 GMT) Full text and rfc822 format available.

bug No longer marked as fixed in versions 25.2. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Sun, 04 Dec 2016 02:50:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 01 Jan 2017 12:24:16 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 172 days ago.

Previous Next


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