Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: Trying to prune the registry because it's full; apply: registry max-size limit reached
Date: Mon, 30 Mar 2015 15:15:11 +0800	[thread overview]
Message-ID: <87ego7ot1c.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87iodjotuo.fsf@ericabrahamsen.net>

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

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Tassilo Horn <tsdh@gnu.org> writes:
>
>> Hi all,
>>
>> just now when I wanted to enter this group, I got the error message
>>
>>   Trying to prune the registry because it's full
>>   apply: registry max-size limit reached
>>
>> with this backtrace:
>>
>> Debugger entered: ((cl-assertion-failed (not (registry-full db)) "registry max-size limit reached"))
>>   cl--assertion-failed((not (registry-full db)) "registry max-size limit reached" nil nil)
>>   registry-insert([eieio-class-tag--registry-db "~/.gnus.d/.gnus.registry.eieio" 0.2 10000 0.1...])
>>   gnus-registry-insert( "<59afc63a-24c7-4b7b-89d8-4b99ba1f3b5b@googlegroups.com>" ((creation-time (21784 58735 12080 293000)) (group) (sender) (subject)))
>>   gnus-registry-get-or-make-entry("<59afc63a-24c7-4b7b-89d8-4b99ba1f3b5b@googlegroups.com>")
>>   gnus-registry-get-id-key("<59afc63a-24c7-4b7b-89d8-4b99ba1f3b5b@googlegroups.com>" group)
>>   gnus-registry-register-message-ids()
>>   run-hooks(gnus-summary-prepare-hook)
>>   apply(run-hooks gnus-summary-prepare-hook)
>>   gnus-run-hooks(gnus-summary-prepare-hook)
>>   gnus-summary-prepare()
>>   gnus-summary-read-group-1("nnimap+Fastmail:INBOX.mailinglists.clojure" nil t nil nil nil)
>>   gnus-summary-read-group("nnimap+Fastmail:INBOX.mailinglists.clojure" nil t nil nil nil nil)
>>   gnus-group-read-group(nil t)
>>   gnus-group-select-group(nil)
>>   gnus-topic-select-group(nil)
>>   funcall-interactively(gnus-topic-select-group nil)
>>   call-interactively(gnus-topic-select-group nil nil)
>>   command-execute(gnus-topic-select-group)
>>
>>
>> My registry-related settings are just
>>
>> (setq gnus-registry-ignored-groups '(("^nntp" t) ("^nndraft" t)
>>                                      ("^nnir" t)
>>                                      ("training" t) ("Junk" t)
>>                                      ("Trash" t) ("Spam" t))
>>       ;; Don't track anything except for the message ids.
>>       gnus-registry-track-extra nil
>>       gnus-registry-max-entries 10000)
>>
>> (gnus-registry-initialize)
>>
>> I had thought that with a maximum number of entries, as soon as I hit
>> it, the registry would prune the oldest entries to regain some space.
>> But according to the messages, it seems that pruning didn't succeed.
>
> This is related to a change I made recently. What used to happen was --
> assuming max entries of 10000 and a prune factor of 0.1 -- every time
> the registry exceeded 9000 (not 10000), it would prune. That wasn't what
> was supposed to happen: it was supposed to hit 10000 and then prune back
> to 9000.
>
> A few days ago I changed it so that it really did reach its max size
> before pruning. Obviously something isn't quite aligned right. I'm
> assuming some sort of off-by-one error: we're using #'< where we should
> be using #'<=, or something like that.

Embarrassingly, that is indeed what was happening. Would you mind giving
this patch a whirl? If it works correctly, I'll push it (plus a
ChangeLog notice).

Sorry about that,

Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-registry-pruning-routine.patch --]
[-- Type: text/x-diff, Size: 1098 bytes --]

From 5e9f920ec706393fd9b3a0d260abd13259b26a0d Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Mon, 30 Mar 2015 15:12:40 +0800
Subject: [PATCH] Fix registry pruning routine

* lisp/registry.el (registry-prune): Re-use `registry-full' in
  `registry-prune'.  It's a bit of redundant work, but safer.  Also
  ensure that target-size is an integer.
---
 lisp/registry.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/registry.el b/lisp/registry.el
index c8d7d85..551cee8 100644
--- a/lisp/registry.el
+++ b/lisp/registry.el
@@ -361,11 +361,12 @@ from the front of the list are deleted first.
 
 Returns the number of deleted entries."
   (let ((size (registry-size db))
-	(target-size (- (oref db max-size)
-			(* (oref db max-size)
-			   (oref db prune-factor))))
+	(target-size
+	 (round (- (oref db max-size)
+		   (* (oref db max-size)
+		      (oref db prune-factor)))))
 	candidates)
-    (if (> size (oref db max-size))
+    (if (registry-full db)
 	(progn
 	  (setq candidates
 		(registry-collect-prune-candidates
-- 
2.3.4


  reply	other threads:[~2015-03-30  7:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-30  6:12 Tassilo Horn
2015-03-30  6:57 ` Eric Abrahamsen
2015-03-30  7:15   ` Eric Abrahamsen [this message]
2015-03-30  9:30     ` Tassilo Horn
2015-03-30  9:45       ` Eric Abrahamsen
2015-03-30 11:02         ` Tassilo Horn
2015-04-17 19:48         ` Ted Zlatanov
2015-04-18  3:22           ` Eric Abrahamsen

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=87ego7ot1c.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    /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.
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).