Gnus development mailing list
 help / color / mirror / Atom feed
* nntp and nnimap disconnect and take forever when emacs is idle
@ 2024-10-22  4:59 Divya Ranjan
  2024-10-22  7:44 ` NNTP Surfer
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Divya Ranjan @ 2024-10-22  4:59 UTC (permalink / raw)
  To: ding

Hello,

Does anyone else also experience this, when they’ve left their Emacs or just gnus idle for sometime, it disconnects from the server, whether nntp or nnimap, and then when you open a group that’s requesting that server, it takes forever to load. Is this one of those things that you have to swallow with Gnus, or is there some hack?

Regards,
-- 
Divya Ranjan,
Philosophy, Mathematics, Libre Software.



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  4:59 nntp and nnimap disconnect and take forever when emacs is idle Divya Ranjan
@ 2024-10-22  7:44 ` NNTP Surfer
  2024-10-24  8:03   ` Gijs Hillenius
  2024-10-24 20:53   ` Divya Ranjan
  2024-10-22  7:57 ` Stephen Berman
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 18+ messages in thread
From: NNTP Surfer @ 2024-10-22  7:44 UTC (permalink / raw)
  To: ding

Divya Ranjan <divya@subvertising.org> writes:

> Does anyone else also experience this, when they’ve left their Emacs
> or just gnus idle for sometime, it disconnects from the server,

Had the same thing. Just set low connection timeout to quickly renew
connections:

#begin_src emacs-lisp
gnus-select-method '(nntp "xxx"
                    (nntp-open-connection-function nntp-open-tls-stream)
                    (nntp-port-number 563)
                    (nntp-address "xxx")
                    (nntp-connection-timeout 5))
#end_src



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  4:59 nntp and nnimap disconnect and take forever when emacs is idle Divya Ranjan
  2024-10-22  7:44 ` NNTP Surfer
@ 2024-10-22  7:57 ` Stephen Berman
  2024-10-22 19:07 ` Jakub Ječmínek
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 18+ messages in thread
From: Stephen Berman @ 2024-10-22  7:57 UTC (permalink / raw)
  To: Divya Ranjan; +Cc: ding

On Tue, 22 Oct 2024 04:59:04 +0000 Divya Ranjan <divya@subvertising.org> wrote:

> Does anyone else also experience this, when they’ve left their Emacs or just
> gnus idle for sometime, it disconnects from the server, whether nntp or
> nnimap, and then when you open a group that’s requesting that server, it takes
> forever to load. Is this one of those things that you have to swallow with
> Gnus, or is there some hack?

At least concerning nntp this sounds like bug#52735 (which I continue to
experience); see also the thread beginning at
<https://lists.gnu.org/archive/html/info-gnus-english/2023-06/msg00014.html>.

I use the following hack, added to my ~/.emacs.d/.gnus.el file:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun srb-gnus-group-get-new-news (&optional arg one-level)
  (interactive "P")
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-group-get-new-news))
    (gnus-group-get-new-news arg one-level)))

(defun srb-gnus-summary-next-unread-article ()
  (interactive)
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-summary-next-unread-article))
    (gnus-summary-next-unread-article)))

(defun srb-gnus-summary-next-page (&optional lines circular stop)
  (interactive "P")
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-summary-next-page))
    (gnus-summary-next-page lines circular stop)))

(defun srb-gnus-summary-scroll-up (lines)
  (interactive "P")
  (with-timeout (1 (kill-buffer (nntp-find-connection-buffer
                                 nntp-server-buffer))
		   (gnus-summary-scroll-up lines))
    (gnus-summary-scroll-up lines)))

(define-key gnus-group-mode-map "g" 'srb-gnus-group-get-new-news)
(define-key gnus-summary-mode-map "n" 'srb-gnus-summary-next-unread-article)
(define-key gnus-summary-mode-map " " 'srb-gnus-summary-next-page)
(define-key gnus-summary-mode-map "\r" 'gnus-summary-scroll-up)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

But this is brittle and doesn't always work.  If you find a real
solution, I'd be interested to see it.

Steve Berman


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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  4:59 nntp and nnimap disconnect and take forever when emacs is idle Divya Ranjan
  2024-10-22  7:44 ` NNTP Surfer
  2024-10-22  7:57 ` Stephen Berman
@ 2024-10-22 19:07 ` Jakub Ječmínek
  2024-10-23 11:50   ` Gijs Hillenius
  2024-10-23  3:27 ` Bob Newell
  2024-10-26 22:53 ` James Thomas
  4 siblings, 1 reply; 18+ messages in thread
From: Jakub Ječmínek @ 2024-10-22 19:07 UTC (permalink / raw)
  To: Divya Ranjan; +Cc: ding

"Divya Ranjan" <divya@subvertising.org> writes:

> Does anyone else also experience this, when they’ve left their Emacs or just
> gnus idle for sometime, it disconnects from the server, whether nntp or
> nnimap, and then when you open a group that’s requesting that server, it takes
> forever to load. Is this one of those things that you have to swallow with
> Gnus, or is there some hack?

Hi, I believe this is known issue. Here's the link with the bug report:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16026

Best,

Kuba



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  4:59 nntp and nnimap disconnect and take forever when emacs is idle Divya Ranjan
                   ` (2 preceding siblings ...)
  2024-10-22 19:07 ` Jakub Ječmínek
@ 2024-10-23  3:27 ` Bob Newell
  2024-10-23 15:10   ` Alberto Luaces
  2024-10-26 22:53 ` James Thomas
  4 siblings, 1 reply; 18+ messages in thread
From: Bob Newell @ 2024-10-23  3:27 UTC (permalink / raw)
  To: ding

> Does anyone else also experience this, when they’ve left their Emacs
> or just gnus idle for sometime, it disconnects from the server,

What I do is run a 'keepalive' every 5 minutes to quickly poke
the server and maintain the connection.  You can do this with
a run-with-timer although I prefer to do it outside of emacs
with a bash script.

-- 
Bob Newell
Honolulu, Hawai`i

- Via GNU-Linux/Emacs/Gnus/BBDB


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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22 19:07 ` Jakub Ječmínek
@ 2024-10-23 11:50   ` Gijs Hillenius
  2024-10-23 11:57     ` Gijs Hillenius
  0 siblings, 1 reply; 18+ messages in thread
From: Gijs Hillenius @ 2024-10-23 11:50 UTC (permalink / raw)
  To: Jakub Ječmínek; +Cc: Divya Ranjan, ding

On 22 October 2024 19:07 Jakub Ječmínek, wrote:

> "Divya Ranjan" <divya@subvertising.org> writes:
>
>> Does anyone else also experience this, when they’ve left their Emacs or just
>> gnus idle for sometime, it disconnects from the server, whether nntp or
>> nnimap, and then when you open a group that’s requesting that server, it takes
>> forever to load. Is this one of those things that you have to swallow with
>> Gnus, or is there some hack?
>
> Hi, I believe this is known issue. Here's the link with the bug report:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16026
>

it's this (or it's related, or a duplicate)

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52735




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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-23 11:50   ` Gijs Hillenius
@ 2024-10-23 11:57     ` Gijs Hillenius
  0 siblings, 0 replies; 18+ messages in thread
From: Gijs Hillenius @ 2024-10-23 11:57 UTC (permalink / raw)
  To: Jakub Ječmínek; +Cc: Divya Ranjan, ding

On 23 October 2024 13:50 Gijs Hillenius, wrote:

> On 22 October 2024 19:07 Jakub Ječmínek, wrote:
>
>> "Divya Ranjan" <divya@subvertising.org> writes:
>>
>>> Does anyone else also experience this, when they’ve left their Emacs or just
>>> gnus idle for sometime, it disconnects from the server, whether nntp or
>>> nnimap, and then when you open a group that’s requesting that server, it takes
>>> forever to load. Is this one of those things that you have to swallow with
>>> Gnus, or is there some hack?
>>
>> Hi, I believe this is known issue. Here's the link with the bug report:
>>
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=16026
>>
>
> it's this (or it's related, or a duplicate)
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=52735

and

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71452



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-23  3:27 ` Bob Newell
@ 2024-10-23 15:10   ` Alberto Luaces
  0 siblings, 0 replies; 18+ messages in thread
From: Alberto Luaces @ 2024-10-23 15:10 UTC (permalink / raw)
  To: ding

Bob Newell writes:

>> Does anyone else also experience this, when they’ve left their Emacs
>> or just gnus idle for sometime, it disconnects from the server,
>
> What I do is run a 'keepalive' every 5 minutes to quickly poke
> the server and maintain the connection.  You can do this with
> a run-with-timer although I prefer to do it outside of emacs
> with a bash script.

I do something along those lines with the following in my gnus.el (but
it could be anywhere else):

(gnus-demon-add-handler 'gnus-demon-scan-news 15 t)

-- 
Alberto



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  7:44 ` NNTP Surfer
@ 2024-10-24  8:03   ` Gijs Hillenius
  2024-10-24  9:20     ` NNTP Surfer
                       ` (2 more replies)
  2024-10-24 20:53   ` Divya Ranjan
  1 sibling, 3 replies; 18+ messages in thread
From: Gijs Hillenius @ 2024-10-24  8:03 UTC (permalink / raw)
  To: NNTP Surfer; +Cc: ding

On 22 October 2024 03:44 NNTP Surfer, wrote:

> Divya Ranjan <divya@subvertising.org> writes:
>
>> Does anyone else also experience this, when they’ve left their Emacs
>> or just gnus idle for sometime, it disconnects from the server,
>
> Had the same thing. Just set low connection timeout to quickly renew
> connections:
>
> #begin_src emacs-lisp
> gnus-select-method '(nntp "xxx"
>                     (nntp-open-connection-function nntp-open-tls-stream)
>                     (nntp-port-number 563)
>                     (nntp-address "xxx")
>                     (nntp-connection-timeout 5))
> #end_src
>
>
>

from:

https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71452

this seems to suggest that 

(setq read-process-output-fast nil)


would work?



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-24  8:03   ` Gijs Hillenius
@ 2024-10-24  9:20     ` NNTP Surfer
  2024-10-24 10:34       ` Gijs Hillenius
  2024-12-03 20:39     ` Björn Bidar
       [not found]     ` <2072.39711178175$1733258446@news.gmane.org>
  2 siblings, 1 reply; 18+ messages in thread
From: NNTP Surfer @ 2024-10-24  9:20 UTC (permalink / raw)
  To: ding

Gijs Hillenius <gijs@hillenius.net> writes:

> On 22 October 2024 03:44 NNTP Surfer, wrote:
> from:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71452
> this seems to suggest that 
> (setq read-process-output-fast nil)
> would work?

No.
I've made test:
1. Set (setq fast-read-process-output nil) globally.
2. Commented every (nntp-connection-timeout 5) to bring back default
setting.
3. Restarted Emacs.
4. Gnus hanged on connection to news.gwene.org

Only using (nntp-connection-timeout 5) fixes this problem for me.



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-24  9:20     ` NNTP Surfer
@ 2024-10-24 10:34       ` Gijs Hillenius
  0 siblings, 0 replies; 18+ messages in thread
From: Gijs Hillenius @ 2024-10-24 10:34 UTC (permalink / raw)
  To: NNTP Surfer; +Cc: ding

On 24 October 2024 05:20 NNTP Surfer, wrote:

> Gijs Hillenius <gijs@hillenius.net> writes:
>
>> On 22 October 2024 03:44 NNTP Surfer, wrote:
>> from:
>> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71452
>> this seems to suggest that 
>> (setq read-process-output-fast nil)
>> would work?
>
> No.
> I've made test:
> 1. Set (setq fast-read-process-output nil) globally.
> 2. Commented every (nntp-connection-timeout 5) to bring back default
> setting.
> 3. Restarted Emacs.


^^ did fast-read-process-output survive?

For me, setting this has so far kept my Gnus alive for four hours non
stop. But yes, that is just one datapoint.


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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  7:44 ` NNTP Surfer
  2024-10-24  8:03   ` Gijs Hillenius
@ 2024-10-24 20:53   ` Divya Ranjan
  2024-11-23 10:28     ` NNTP Surfer
  1 sibling, 1 reply; 18+ messages in thread
From: Divya Ranjan @ 2024-10-24 20:53 UTC (permalink / raw)
  To: ding

NNTP Surfer <nntpsurfer@op.pl> writes:

> Divya Ranjan <divya@subvertising.org> writes:
>
>> Does anyone else also experience this, when they’ve left their Emacs
>> or just gnus idle for sometime, it disconnects from the server,
>
> Had the same thing. Just set low connection timeout to quickly renew
> connections:
>
> #begin_src emacs-lisp
> gnus-select-method '(nntp "xxx"
>                     (nntp-open-connection-function nntp-open-tls-stream)
>                     (nntp-port-number 563)
>                     (nntp-address "xxx")
>                     (nntp-connection-timeout 5))
> #end_src

Thank you for this, it seems to have fixed it for nntp connections, but what about nnimap?

-- 
Divya Ranjan,
Philosophy, Mathematics, Libre Software.



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-22  4:59 nntp and nnimap disconnect and take forever when emacs is idle Divya Ranjan
                   ` (3 preceding siblings ...)
  2024-10-23  3:27 ` Bob Newell
@ 2024-10-26 22:53 ` James Thomas
  4 siblings, 0 replies; 18+ messages in thread
From: James Thomas @ 2024-10-26 22:53 UTC (permalink / raw)
  To: ding

Divya Ranjan wrote:

> Hello,
>
> Does anyone else also experience this, when they’ve left their Emacs
> or just gnus idle for sometime, it disconnects from the server,
> whether nntp or nnimap, and then when you open a group that’s
> requesting that server, it takes forever to load. Is this one of those
> things that you have to swallow with Gnus, or is there some hack?

You can close the connection(s) when idle. See (info "(gnus) Daemons").

--


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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-24 20:53   ` Divya Ranjan
@ 2024-11-23 10:28     ` NNTP Surfer
  0 siblings, 0 replies; 18+ messages in thread
From: NNTP Surfer @ 2024-11-23 10:28 UTC (permalink / raw)
  To: ding

Divya Ranjan <divya@subvertising.org> writes:
> Thank you for this, it seems to have fixed it for nntp connections,
> but what about nnimap?

I use this and everything just works:

#+begin_src emacs-lisp
(nnimap "xxx@xx.pl"
        (nnimap-address "xxx.xxx.onet.pl")
        (nnimap-server-port "imaps")
        (nnimap-stream ssl)
        (nnimap-expunge 'immediate)
        (nnimap-keepalive (450 . 150)))
#+end_src




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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-10-24  8:03   ` Gijs Hillenius
  2024-10-24  9:20     ` NNTP Surfer
@ 2024-12-03 20:39     ` Björn Bidar
       [not found]     ` <2072.39711178175$1733258446@news.gmane.org>
  2 siblings, 0 replies; 18+ messages in thread
From: Björn Bidar @ 2024-12-03 20:39 UTC (permalink / raw)
  To: Gijs Hillenius; +Cc: NNTP Surfer, ding

Gijs Hillenius <gijs@hillenius.net> writes:

> On 22 October 2024 03:44 NNTP Surfer, wrote:
>
>> Divya Ranjan <divya@subvertising.org> writes:
>>
>>> Does anyone else also experience this, when they’ve left their Emacs
>>> or just gnus idle for sometime, it disconnects from the server,
>>
>> Had the same thing. Just set low connection timeout to quickly renew
>> connections:
>>
>> #begin_src emacs-lisp
>> gnus-select-method '(nntp "xxx"
>>                     (nntp-open-connection-function nntp-open-tls-stream)
>>                     (nntp-port-number 563)
>>                     (nntp-address "xxx")
>>                     (nntp-connection-timeout 5))
>> #end_src
>>
>>
>>
>
> from:
>
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=71452
>
> this seems to suggest that 
>
> (setq read-process-output-fast nil)

The variable doesn't exist (anymore).


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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
       [not found]     ` <2072.39711178175$1733258446@news.gmane.org>
@ 2024-12-04 13:00       ` Robert Pluim
  2024-12-06 10:13         ` Gijs Hillenius
  0 siblings, 1 reply; 18+ messages in thread
From: Robert Pluim @ 2024-12-04 13:00 UTC (permalink / raw)
  To: Gijs Hillenius; +Cc: NNTP Surfer, ding

>>>>> On Tue, 03 Dec 2024 22:39:54 +0200, Björn Bidar <bjorn.bidar@thaodan.de> said:

    >> this seems to suggest that 
    >> 
    >> (setq read-process-output-fast nil)

    Björn> The variable doesn't exist (anymore).

It was renamed to `fast-read-process-output'

Robert
-- 


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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-12-04 13:00       ` Robert Pluim
@ 2024-12-06 10:13         ` Gijs Hillenius
  2024-12-06 10:22           ` Robert Pluim
  0 siblings, 1 reply; 18+ messages in thread
From: Gijs Hillenius @ 2024-12-06 10:13 UTC (permalink / raw)
  To: Robert Pluim; +Cc: NNTP Surfer, ding

On  4 December 2024 14:00 Robert Pluim, wrote:

>>>>>> On Tue, 03 Dec 2024 22:39:54 +0200, Björn Bidar <bjorn.bidar@thaodan.de> said:
>
>     >> this seems to suggest that 
>     >> 
>     >> (setq read-process-output-fast nil)
>
>     Björn> The variable doesn't exist (anymore).
>
> It was renamed to `fast-read-process-output'

Aha!

In addition, do I understand correctly that it's not in Emacs 29, but in
the upcoming 30?

Looking forward to testing it out



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

* Re: nntp and nnimap disconnect and take forever when emacs is idle
  2024-12-06 10:13         ` Gijs Hillenius
@ 2024-12-06 10:22           ` Robert Pluim
  0 siblings, 0 replies; 18+ messages in thread
From: Robert Pluim @ 2024-12-06 10:22 UTC (permalink / raw)
  To: Gijs Hillenius; +Cc: NNTP Surfer, ding

>>>>> On Fri, 06 Dec 2024 11:13:06 +0100, Gijs Hillenius <gijs@hillenius.net> said:

    Gijs> On  4 December 2024 14:00 Robert Pluim, wrote:
    >>>>>>> On Tue, 03 Dec 2024 22:39:54 +0200, Björn Bidar <bjorn.bidar@thaodan.de> said:
    >> 
    >> >> this seems to suggest that 
    >> >> 
    >> >> (setq read-process-output-fast nil)
    >> 
    Björn> The variable doesn't exist (anymore).
    >> 
    >> It was renamed to `fast-read-process-output'

    Gijs> Aha!

    Gijs> In addition, do I understand correctly that it's not in Emacs 29, but in
    Gijs> the upcoming 30?

Yes, itʼs an emacs-30 feature. From etc/NEWS:

    ** The default process filter was rewritten in native code.
    The round-trip through the Lisp function
    'internal-default-process-filter' is skipped when the process filter is
    the default one.  It is reimplemented in native code, reducing GC churn.
    To undo this change, set 'fast-read-process-output' to nil.


Robert
-- 


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

end of thread, other threads:[~2024-12-06 10:22 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-22  4:59 nntp and nnimap disconnect and take forever when emacs is idle Divya Ranjan
2024-10-22  7:44 ` NNTP Surfer
2024-10-24  8:03   ` Gijs Hillenius
2024-10-24  9:20     ` NNTP Surfer
2024-10-24 10:34       ` Gijs Hillenius
2024-12-03 20:39     ` Björn Bidar
     [not found]     ` <2072.39711178175$1733258446@news.gmane.org>
2024-12-04 13:00       ` Robert Pluim
2024-12-06 10:13         ` Gijs Hillenius
2024-12-06 10:22           ` Robert Pluim
2024-10-24 20:53   ` Divya Ranjan
2024-11-23 10:28     ` NNTP Surfer
2024-10-22  7:57 ` Stephen Berman
2024-10-22 19:07 ` Jakub Ječmínek
2024-10-23 11:50   ` Gijs Hillenius
2024-10-23 11:57     ` Gijs Hillenius
2024-10-23  3:27 ` Bob Newell
2024-10-23 15:10   ` Alberto Luaces
2024-10-26 22:53 ` James Thomas

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 NNTP newsgroup(s).