GNU bug report logs - #43682
28.0.50; Clean up nnimap server buffers?

Previous Next

Package: emacs;

Reported by: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Date: Mon, 28 Sep 2020 23:38:02 UTC

Severity: normal

Found in version 28.0.50

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

Full log


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

From: Robert Pluim <rpluim <at> gmail.com>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 43682 <at> debbugs.gnu.org
Subject: Re: bug#43682: 28.0.50; Clean up nnimap server buffers?
Date: Tue, 29 Sep 2020 09:42:05 +0200
>>>>> On Mon, 28 Sep 2020 16:37:15 -0700, Eric Abrahamsen <eric <at> ericabrahamsen.net> said:

    Eric> Someone noted on gnus.general that their imap connections are frequently
    Eric> broken, and they end up with a lot of dead process buffers.

    Eric> I'm talking to them about maybe making the keepalive timeout
    Eric> configurable, but wouldn't also be tidy to clean up dead process
    Eric> buffers? How does the attached patch look?

    Eric> Eric

    Eric> diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
    Eric> index d797e893f5..7f2ebe279e 100644
    Eric> --- a/lisp/gnus/nnimap.el
    Eric> +++ b/lisp/gnus/nnimap.el
    Eric> @@ -407,8 +407,15 @@ nnimap-keepalive
    Eric>  		      (time-subtract
    Eric>  		       now
    Eric>  		       (nnimap-last-command-time nnimap-object))))
    Eric> -            (ignore-errors              ;E.g. "buffer foo has no process".
    Eric> -              (nnimap-send-command "NOOP"))))))))
    Eric> +	    (condition-case err
    Eric> +		(process-send-string "NOOP")
    Eric> +	      (error
    Eric> +	       (if (string-search "has no process" (cdr err))
    Eric> +		   (let ((buf (current-buffer)))
    Eric> +		     (setq nnimap-process-buffers
    Eric> +			   (delq buf nnimap-process-buffers))
    Eric> +		     (kill-buffer buf))
    Eric> +		 (signal (car err) (cdr err)))))))))))

Thatʼs not how you call process-send-string, and the
nnimap-send-command is there for a reason: it deals with imap sequence
numbers.

Also I donʼt think 'has no process' is the only error
'process-send-string' can signal. I see at least 'not running' and
'Output file descriptor.*is closed'

Robert
-- 




This bug report was last modified 3 years and 222 days ago.

Previous Next


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