all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: 43682@debbugs.gnu.org
Subject: bug#43682: 28.0.50; Clean up nnimap server buffers?
Date: Tue, 29 Sep 2020 09:42:05 +0200	[thread overview]
Message-ID: <m2ft71uj02.fsf@gmail.com> (raw)
In-Reply-To: <87eemlh3ro.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 28 Sep 2020 16:37:15 -0700")

>>>>> On Mon, 28 Sep 2020 16:37:15 -0700, Eric Abrahamsen <eric@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
-- 





  reply	other threads:[~2020-09-29  7:42 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-28 23:37 bug#43682: 28.0.50; Clean up nnimap server buffers? Eric Abrahamsen
2020-09-29  7:42 ` Robert Pluim [this message]
2020-09-29 14:51 ` Lars Ingebrigtsen
2020-09-29 18:25   ` Eric Abrahamsen
2020-09-30  1:18     ` Lars Ingebrigtsen
2020-09-30  1:21       ` Lars Ingebrigtsen
2020-09-30 21:49       ` Eric Abrahamsen
2020-10-01  1:30         ` Lars Ingebrigtsen
2020-10-01  5:09           ` Eric Abrahamsen
2020-10-01 16:01             ` Lars Ingebrigtsen
2020-10-01 17:25               ` Eric Abrahamsen
2021-10-11 12:53                 ` Stefan Kangas
2021-10-11 14:41                   ` Eric Abrahamsen
2021-10-12 20:50                   ` Eric Abrahamsen
2021-10-12 21:33                     ` Stefan Kangas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2ft71uj02.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=43682@debbugs.gnu.org \
    --cc=eric@ericabrahamsen.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.