unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#18527: 24.3; ERC does not reconnect when server disconnects me
@ 2014-09-22 14:28 Robert Brown
  2015-12-27 20:41 ` Lars Ingebrigtsen
  2016-03-25 18:21 ` bug#18527: the fix for this bug was clobbered by a subsequent merge commit Chris Brannon
  0 siblings, 2 replies; 9+ messages in thread
From: Robert Brown @ 2014-09-22 14:28 UTC (permalink / raw)
  To: 18527

I use ERC to connect to IRC servers.  ERC's automatic reconnection
feature does not appear to work when the IRC server initiates the
disconnection.  I have erc-server-reconnect-attempts set to t.

Here is a recent example:

*** netjoin: *.net *.split, 20 were split                               [10:15]
==> ERROR from irc.freenode.net: Closing Link: nat/google/x-onzfdymblldcwdch
    (Ping timeout: 272 seconds)                                         [10:47]
*** irc.freenode.net closed 

Connection failed!  Not re-establishing connection.

*** ERC terminated: finished



In GNU Emacs 24.3.2 (x86_64-unknown-linux-gnu)
 of 2014-03-25 on paradicsom.nyc.corp.google.com
System Description:	Ubuntu 14.04 LTS (upgraded from: Ubuntu 12.04.4 LTS)

Configured using:
 `configure '--prefix=/local/software/package/emacs-24.3.1'
 '--without-x''

Important settings:
  value of $LC_ALL: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: ERC

Minor modes in effect:
  erc-list-mode: t
  erc-menu-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
  erc-autojoin-mode: t
  erc-irccontrols-mode: t
  erc-noncommands-mode: t
  erc-move-to-prompt-mode: t
  erc-readonly-mode: t
  show-paren-mode: t
  shell-dirtrack-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t

Recent input:
t - t i m e o u t ' , SPC ` e r c - s e r v e r - s 
e n d - p i n g - i n t e r v a l ' , SPC a n d RET 
` e r c - s e r v e r - s e n d - p i n g - t i m e 
o u t ' SPC t o SPC f i n e - t u n e SPC E R C ' s 
SPC b e h a v i o r . RET C-p C-p C-p C-d ESC f ESC 
f ESC f ESC f C-o C-o C-j C-n C-n C-d C-d C-d C-d ESC 
f ESC f ESC f ESC f C-k C-j C-n C-d ESC f ESC f ESC 
f ESC f C-o C-o C-j C-n C-n C-d C-d C-d C-d ESC f ESC 
f ESC f ESC f ESC f C-o C-o C-o C-j RET C-d C-d C-d 
C-d C-d C-d C-d C-d C-d C-d C-d ESC f ESC f ESC f ESC 
f ESC f C-o C-o C-j C-u C-p C-p C-p C-p C-p C-n C-n 
C-x b RET C-g C-x C-b C-n C-n C-n SPC ESC x b u g TAB 
ESC DEL ESC DEL e m a c s - b u g TAB TAB TAB DEL DEL 
DEL DEL DEL DEL DEL DEL DEL C-h C-h a C-h C-g C-g C-g 
C-h a b u g RET C-x o C-s r e p o r t C-a C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-e C-a C-x 
o C-x 1 ESC x r e p o r t - TAB RET

Recent messages:
Quit
Making completion list... [3 times]
uncompressing erc.el.gz...done
ERC Version 5.3 (GNU Emacs 24.3.2)
Quit
<<< Type SPC or RET to bury the buffer list >>>
apropos-read-pattern: Command attempted to use minibuffer while in minibuffer
Quit [3 times]
Type C-x 1 to remove help window.  
Mark saved where search started

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mail-utils misearch multi-isearch
jka-compr dired help-mode mule-util ebuff-menu electric network-stream
starttls tls erc-menu erc-ring erc-networks erc-pcomplete erc-track
erc-match erc-button wid-edit erc-fill erc-stamp erc-netsplit erc-join
erc-goodies erc erc-backend erc-compat paren magit-autoloads info
git-rebase-mode-autoloads git-commit-mode-autoloads finder-inf package
uniquify vm-autoloads vm-version vm-vars slime-tramp tramp tramp-compat
auth-source eieio gnus-util time-date mm-util mail-prsvr password-cache
tramp-loaddefs shell pcomplete format-spec slime-sprof slime-indentation
slime-cl-indent cl-indent slime-highlight-edits warnings slime-fancy
slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references
slime-scratch slime-presentations bridge slime-fuzzy slime-fancy-trace
slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc
advice advice-preload eldoc slime-compiler-notes-tree slime-banner
slime-asdf slime-repl slime-parse grep slime byte-opt bytecomp
byte-compile cconv derived gud compile tool-bar apropos etags arc-mode
archive-mode noutline outline easy-mmode easymenu pp comint ansi-color
ring hyperspec thingatpt browse-url slime-autoloads regexp-opt help-fns
edmacro kmacro cl-macs gv cl cl-lib ediff-hook vc-hooks lisp-float-type
tabulated-list newcomment lisp-mode register page menu-bar rfn-eshadow
timer jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer loaddefs button faces cus-face macroexp files text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process multi-tty emacs)





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: 24.3; ERC does not reconnect when server disconnects me
  2014-09-22 14:28 bug#18527: 24.3; ERC does not reconnect when server disconnects me Robert Brown
@ 2015-12-27 20:41 ` Lars Ingebrigtsen
  2015-12-28 18:18   ` Robert Brown
  2016-03-25 18:21 ` bug#18527: the fix for this bug was clobbered by a subsequent merge commit Chris Brannon
  1 sibling, 1 reply; 9+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-27 20:41 UTC (permalink / raw)
  To: Robert Brown; +Cc: 18527, Robert Brown

Robert Brown <brown@google.com> writes:

> I use ERC to connect to IRC servers.  ERC's automatic reconnection
> feature does not appear to work when the IRC server initiates the
> disconnection.  I have erc-server-reconnect-attempts set to t.
>
> Here is a recent example:
>
> *** netjoin: *.net *.split, 20 were split                               [10:15]
> ==> ERROR from irc.freenode.net: Closing Link: nat/google/x-onzfdymblldcwdch
>     (Ping timeout: 272 seconds)                                         [10:47]
> *** irc.freenode.net closed 
>
> Connection failed!  Not re-establishing connection.
>
> *** ERC terminated: finished

Can you load an uncompiled erc source and then edebug through this to
see what it is that says that we don't want to connect?

(defsubst 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."
  (or erc-server-reconnecting
      (and erc-server-auto-reconnect
           (not erc-server-banned)
           (not erc-server-error-occurred)
           ;; 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))))

My guess would be erc-server-error-occurred, and in that case I wonder
what triggered that variable to become set.

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: 24.3; ERC does not reconnect when server disconnects me
  2015-12-27 20:41 ` Lars Ingebrigtsen
@ 2015-12-28 18:18   ` Robert Brown
  2015-12-28 18:23     ` Lars Ingebrigtsen
       [not found]     ` <87vb7itot1.fsf@gnus.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Robert Brown @ 2015-12-28 18:18 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18527

Thanks for getting back to me about this issue.  It's been several
months since I reported the reconnection problem.  I have been
able to work around it by setting erc-server-error-occurred to nil
in a disconnect hook:

(add-hook 'erc-disconnected-hook
          #'(lambda (nick host-name reason)
              ;; Re-establish the connection even if the server closed it.
              (setq erc-server-error-occurred nil)))

So yes, when the root cause of the disconnection is a server error,
erc-server-error-occurred is set to true and the reconnect logic
in erc-server-reconnect-p is bypassed ... so reconnection does not
happen.

In the example I sent you, I believe the server closed the connection
and erc-server-error-occurred was set to true because of a ping
timeout.

I would prefer that erc-server-reconnect-p not check
erc-server-error-occurred so that reconnection can happen even
if the cause of the disconnect was a server error.


On Sun, Dec 27, 2015 at 3:41 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Robert Brown <brown@google.com> writes:
>
>> I use ERC to connect to IRC servers.  ERC's automatic reconnection
>> feature does not appear to work when the IRC server initiates the
>> disconnection.  I have erc-server-reconnect-attempts set to t.
>>
>> Here is a recent example:
>>
>> *** netjoin: *.net *.split, 20 were split                               [10:15]
>> ==> ERROR from irc.freenode.net: Closing Link: nat/google/x-onzfdymblldcwdch
>>     (Ping timeout: 272 seconds)                                         [10:47]
>> *** irc.freenode.net closed
>>
>> Connection failed!  Not re-establishing connection.
>>
>> *** ERC terminated: finished
>
> Can you load an uncompiled erc source and then edebug through this to
> see what it is that says that we don't want to connect?
>
> (defsubst 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."
>   (or erc-server-reconnecting
>       (and erc-server-auto-reconnect
>            (not erc-server-banned)
>            (not erc-server-error-occurred)
>            ;; 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))))
>
> My guess would be erc-server-error-occurred, and in that case I wonder
> what triggered that variable to become set.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: 24.3; ERC does not reconnect when server disconnects me
  2015-12-28 18:18   ` Robert Brown
@ 2015-12-28 18:23     ` Lars Ingebrigtsen
       [not found]     ` <87vb7itot1.fsf@gnus.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-28 18:23 UTC (permalink / raw)
  To: Robert Brown; +Cc: 18527, ERC Discussion

Robert Brown <robert.brown@gmail.com> writes:

> Thanks for getting back to me about this issue.  It's been several
> months since I reported the reconnection problem.  I have been
> able to work around it by setting erc-server-error-occurred to nil
> in a disconnect hook:
>
> (add-hook 'erc-disconnected-hook
>           #'(lambda (nick host-name reason)
>               ;; Re-establish the connection even if the server closed it.
>               (setq erc-server-error-occurred nil)))
>
> So yes, when the root cause of the disconnection is a server error,
> erc-server-error-occurred is set to true and the reconnect logic
> in erc-server-reconnect-p is bypassed ... so reconnection does not
> happen.
>
> In the example I sent you, I believe the server closed the connection
> and erc-server-error-occurred was set to true because of a ping
> timeout.
>
> I would prefer that erc-server-reconnect-p not check
> erc-server-error-occurred so that reconnection can happen even
> if the cause of the disconnect was a server error.

I think that sounds reasonable, but there may be reasons for that logic.
I've Cc'd the erc mailing list to see whether they have any comments...

This is the function that determines whether to reconnect, and the
suggestion is to remove the line about erc-server-error-occurred:

(defsubst 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."
  (or erc-server-reconnecting
      (and erc-server-auto-reconnect
           (not erc-server-banned)
           (not erc-server-error-occurred)
           ;; 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))))


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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: [Erc-discuss] bug#18527: 24.3; ERC does not reconnect when server disconnects me
       [not found]     ` <87vb7itot1.fsf@gnus.org>
@ 2015-12-28 18:29       ` Michael Olson
  2015-12-28 19:53         ` Lars Ingebrigtsen
       [not found]         ` <87a8outko1.fsf@gnus.org>
  0 siblings, 2 replies; 9+ messages in thread
From: Michael Olson @ 2015-12-28 18:29 UTC (permalink / raw)
  To: ERC Discussion; +Cc: 18527, Robert Brown

[-- Attachment #1: Type: text/plain, Size: 2673 bytes --]

Removing that line seems OK to me.

On Mon, Dec 28, 2015 at 10:23 AM, Lars Ingebrigtsen <larsi@gnus.org> wrote:

> Robert Brown <robert.brown@gmail.com> writes:
>
> > Thanks for getting back to me about this issue.  It's been several
> > months since I reported the reconnection problem.  I have been
> > able to work around it by setting erc-server-error-occurred to nil
> > in a disconnect hook:
> >
> > (add-hook 'erc-disconnected-hook
> >           #'(lambda (nick host-name reason)
> >               ;; Re-establish the connection even if the server closed
> it.
> >               (setq erc-server-error-occurred nil)))
> >
> > So yes, when the root cause of the disconnection is a server error,
> > erc-server-error-occurred is set to true and the reconnect logic
> > in erc-server-reconnect-p is bypassed ... so reconnection does not
> > happen.
> >
> > In the example I sent you, I believe the server closed the connection
> > and erc-server-error-occurred was set to true because of a ping
> > timeout.
> >
> > I would prefer that erc-server-reconnect-p not check
> > erc-server-error-occurred so that reconnection can happen even
> > if the cause of the disconnect was a server error.
>
> I think that sounds reasonable, but there may be reasons for that logic.
> I've Cc'd the erc mailing list to see whether they have any comments...
>
> This is the function that determines whether to reconnect, and the
> suggestion is to remove the line about erc-server-error-occurred:
>
> (defsubst 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."
>   (or erc-server-reconnecting
>       (and erc-server-auto-reconnect
>            (not erc-server-banned)
>            (not erc-server-error-occurred)
>            ;; 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))))
>
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no
>
> _______________________________________________
> Erc-discuss mailing list
> Erc-discuss@gnu.org
> https://lists.gnu.org/mailman/listinfo/erc-discuss
>

[-- Attachment #2: Type: text/html, Size: 3702 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: [Erc-discuss] bug#18527: 24.3; ERC does not reconnect when server disconnects me
  2015-12-28 18:29       ` bug#18527: [Erc-discuss] " Michael Olson
@ 2015-12-28 19:53         ` Lars Ingebrigtsen
       [not found]         ` <87a8outko1.fsf@gnus.org>
  1 sibling, 0 replies; 9+ messages in thread
From: Lars Ingebrigtsen @ 2015-12-28 19:53 UTC (permalink / raw)
  To: Michael Olson; +Cc: ERC Discussion, Robert Brown, 18527

Michael Olson <mwolson@gnu.org> writes:

> Removing that line seems OK to me.

Ok; I've now done so in the Emacs trunk.

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





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: [Erc-discuss] bug#18527: 24.3; ERC does not reconnect when server disconnects me
       [not found]         ` <87a8outko1.fsf@gnus.org>
@ 2015-12-28 19:54           ` Robert Brown
  0 siblings, 0 replies; 9+ messages in thread
From: Robert Brown @ 2015-12-28 19:54 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 18527

Thanks very much.


On Mon, Dec 28, 2015 at 2:53 PM, Lars Ingebrigtsen <larsi@gnus.org> wrote:
> Michael Olson <mwolson@gnu.org> writes:
>
>> Removing that line seems OK to me.
>
> Ok; I've now done so in the Emacs trunk.
>
> --
> (domestic pets only, the antidote for overdose, milk.)
>    bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: the fix for this bug was clobbered by a subsequent merge commit
  2014-09-22 14:28 bug#18527: 24.3; ERC does not reconnect when server disconnects me Robert Brown
  2015-12-27 20:41 ` Lars Ingebrigtsen
@ 2016-03-25 18:21 ` Chris Brannon
  2016-03-27  0:19   ` John Wiegley
  1 sibling, 1 reply; 9+ messages in thread
From: Chris Brannon @ 2016-03-25 18:21 UTC (permalink / raw)
  To: 18527

This was fixed with commit
d686802510c3902f6be4a4c4e82b1134d9dfb8a0,
but the fix was clobbered by the merge commit
9f2f14a0725211b13a744573344636b57b9c98b9.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#18527: the fix for this bug was clobbered by a subsequent merge commit
  2016-03-25 18:21 ` bug#18527: the fix for this bug was clobbered by a subsequent merge commit Chris Brannon
@ 2016-03-27  0:19   ` John Wiegley
  0 siblings, 0 replies; 9+ messages in thread
From: John Wiegley @ 2016-03-27  0:19 UTC (permalink / raw)
  To: Chris Brannon; +Cc: 18527

>>>>> Chris Brannon <chris@the-brannons.com> writes:

> This was fixed with commit
> d686802510c3902f6be4a4c4e82b1134d9dfb8a0,
> but the fix was clobbered by the merge commit
> 9f2f14a0725211b13a744573344636b57b9c98b9.

Thanks for letting me know!  I'll restore the fix.

-- 
John Wiegley                  GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com                          60E1 46C4 BD1A 7AC1 4BA2





^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-03-27  0:19 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 14:28 bug#18527: 24.3; ERC does not reconnect when server disconnects me Robert Brown
2015-12-27 20:41 ` Lars Ingebrigtsen
2015-12-28 18:18   ` Robert Brown
2015-12-28 18:23     ` Lars Ingebrigtsen
     [not found]     ` <87vb7itot1.fsf@gnus.org>
2015-12-28 18:29       ` bug#18527: [Erc-discuss] " Michael Olson
2015-12-28 19:53         ` Lars Ingebrigtsen
     [not found]         ` <87a8outko1.fsf@gnus.org>
2015-12-28 19:54           ` Robert Brown
2016-03-25 18:21 ` bug#18527: the fix for this bug was clobbered by a subsequent merge commit Chris Brannon
2016-03-27  0:19   ` John Wiegley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).