From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#43682: 28.0.50; Clean up nnimap server buffers? Date: Tue, 29 Sep 2020 09:42:05 +0200 Message-ID: References: <87eemlh3ro.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22725"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43682@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 29 10:02:30 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kNAaj-0005n8-PT for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Sep 2020 10:02:29 +0200 Original-Received: from localhost ([::1]:40388 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kNAai-00013H-LR for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Sep 2020 04:02:28 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kNAHv-0008EY-07 for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 03:43:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43312) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kNAHt-0004zI-Mg for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 03:43:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kNAHt-0003Hd-KB for bug-gnu-emacs@gnu.org; Tue, 29 Sep 2020 03:43:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Sep 2020 07:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43682 X-GNU-PR-Package: emacs Original-Received: via spool by 43682-submit@debbugs.gnu.org id=B43682.160136533412560 (code B ref 43682); Tue, 29 Sep 2020 07:43:01 +0000 Original-Received: (at 43682) by debbugs.gnu.org; 29 Sep 2020 07:42:14 +0000 Original-Received: from localhost ([127.0.0.1]:54858 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNAH8-0003GV-A3 for submit@debbugs.gnu.org; Tue, 29 Sep 2020 03:42:14 -0400 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:40690) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kNAH7-0003GH-Ce for 43682@debbugs.gnu.org; Tue, 29 Sep 2020 03:42:13 -0400 Original-Received: by mail-wr1-f45.google.com with SMTP id j2so4159937wrx.7 for <43682@debbugs.gnu.org>; Tue, 29 Sep 2020 00:42:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :mime-version:content-transfer-encoding; bh=Ch9Xy8g2av8LJp7ST4l8/fa6Va+TTKAaiz1weyYj+cc=; b=QAYTw1p0d1CX5wR1pf22HsvowZk/kHf2oG8hOSR7tH69vjf8NC+55tSpTqGW7VbDmw csNAHd88bM11c3/wZftlomEAUxGEaaKTVHIBRyrNSUkFwSeufKOEPa8tLHismZRwWNI1 UVX84gZVljN9tdR9CmKyxK2byLKdsUQujct2QwTRUDda32+wSpzg6rNFtTdsf28hp0z+ q35rt9o5SbJyOLXMBqMkc5cBAgfk90kur+V55ohqCQ8WPw5MVboT1QeJ/xVO52Jx9WGu 5O/9sULd7gC+BnEIvJQUNq9it5uolgKf1NM3vTCxMvhGr8okhPEFXlKbII/JONTDWJbT mRug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=Ch9Xy8g2av8LJp7ST4l8/fa6Va+TTKAaiz1weyYj+cc=; b=nvVlEoQnWPvvjE5vmzLAzsxDHF+t6RBN0M9himKPBomroAsv4wpPYqdAKgLm7g/bCm wYrrP3RltD2GXCtcsMbXSrAVnkLyXOB3SU4QbZq0oLdx/WDShw3F78Ugd/8oWDXKLEis llPG3dJbW6zDKwYVf2tOgp9yvEt/DwRm5WHqDcJJMtBEsgCNFlFwQf85CDMLU5HjB/Nc vTivJ/9MTEdyDXZhnhQjJJaGlyYrMvS1sGurOd6kjM+dr4z2bkyNP1NGqitocvFtVhcu H/cKmjThInp3RdNd38/aBxKlchliNhFQ4lMkMnYALHdeubKtTc0xwDiGSkyzBmpCgTzs M/Mw== X-Gm-Message-State: AOAM533/NT9HGZ3yX6AbgY4VMjVBckN0MF7FUJ8Ixx8sxAsEFJSS5z9C eKJY0QgO4hFrvbsRxd59XeQ4Q3Ycs18= X-Google-Smtp-Source: ABdhPJxh0eGViNDzneyxJs2vxM6OjXPCh6dpVDvLxU93QHKuAF2libnEerR86gp3dI55dbtnj+HQ3g== X-Received: by 2002:adf:92c2:: with SMTP id 60mr2814498wrn.220.1601365326900; Tue, 29 Sep 2020 00:42:06 -0700 (PDT) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:ec55:f484:fbc:8e04]) by smtp.gmail.com with ESMTPSA id i15sm4857778wrb.91.2020.09.29.00.42.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2020 00:42:05 -0700 (PDT) In-Reply-To: <87eemlh3ro.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Mon, 28 Sep 2020 16:37:15 -0700") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:189238 Archived-At: >>>>> On Mon, 28 Sep 2020 16:37:15 -0700, Eric Abrahamsen said: Eric> Someone noted on gnus.general that their imap connections are fre= quently 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=CA=BCs 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=CA=BCt 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 --=20