Gnus development mailing list
 help / color / mirror / Atom feed
* expiry problems?
@ 2001-11-09 14:32 Josh Huber
  2001-11-09 15:53 ` Harry Putnam
  2001-11-09 16:56 ` Matt Armstrong
  0 siblings, 2 replies; 10+ messages in thread
From: Josh Huber @ 2001-11-09 14:32 UTC (permalink / raw)


Is anyone else experiencing expiry problems?  Perhaps I'm missing
something and my configuration is busted, but I have groups that
should have expired articles a long time ago, but haven't.

I have a topic parameter for the "Debian" topic which is

(total-expire . t)

for example:

(gnus-group-find-parameter "mail.lists.debian.devel")

=> ((to-list . "debian-devel@lists.debian.org") (total-expire . t)
   (subscribed . t))

This group has 7600+ messages in it (it really does, I checked the
nnml directory, so it's not just a problem of the article count
estimate).  Of course, many of them are older than my
nnmail-expiry-wait value of 7 days.

C-c C-x on that group outputs a message "Expiring articles in
mail.lists.debian.devel...<pause of ~3 seconds>done"

Perhaps there is something else controlling expiry that I'm missing?

nnmail-expiry-wait-function is nil.

thanks,

-- 
Josh Huber



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

* Re: expiry problems?
  2001-11-09 14:32 expiry problems? Josh Huber
@ 2001-11-09 15:53 ` Harry Putnam
  2001-11-09 16:56 ` Matt Armstrong
  1 sibling, 0 replies; 10+ messages in thread
From: Harry Putnam @ 2001-11-09 15:53 UTC (permalink / raw)


Josh Huber <huber@alum.wpi.edu> writes:

> This group has 7600+ messages in it (it really does, I checked the
> nnml directory, so it's not just a problem of the article count
> estimate).  Of course, many of them are older than my
> nnmail-expiry-wait value of 7 days.

May not be related but I see this in agentized/nntp groups.  I think 
gnus-agent-expire is a different critter though.

My agent groups are set to expire up to 21 days ago but many of them
show a coninuum of messages from late August to now.  None of those
are ticked or dormant.  I wonder if something was changed in late August
or there abouts?

gnus-agent-expire-days's value is 21, but when I run 
gnus-agent-expire, I still see several mnth old messages.

Hasn't been a big enough problem to track it down yet..



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

* Re: expiry problems?
  2001-11-09 14:32 expiry problems? Josh Huber
  2001-11-09 15:53 ` Harry Putnam
@ 2001-11-09 16:56 ` Matt Armstrong
  2001-11-09 18:09   ` Josh Huber
  1 sibling, 1 reply; 10+ messages in thread
From: Matt Armstrong @ 2001-11-09 16:56 UTC (permalink / raw)


Josh Huber <huber@alum.wpi.edu> writes:

> Is anyone else experiencing expiry problems?  Perhaps I'm missing
> something and my configuration is busted, but I have groups that
> should have expired articles a long time ago, but haven't.

What is your gnus-summary-prepare-exit-hook set to?

>From gnus.el:

(defcustom gnus-summary-prepare-exit-hook
  '(gnus-summary-expire-articles)
  "*A hook called when preparing to exit from the summary buffer.
It calls `gnus-summary-expire-articles' by default."
  :group 'gnus-summary-exit
  :type 'hook)


-- 
matt



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

* Re: expiry problems?
  2001-11-09 16:56 ` Matt Armstrong
@ 2001-11-09 18:09   ` Josh Huber
  2001-11-09 19:17     ` Matt Armstrong
  0 siblings, 1 reply; 10+ messages in thread
From: Josh Huber @ 2001-11-09 18:09 UTC (permalink / raw)


"Matt Armstrong" <matt+dated+1007916971.1436bf@lickey.com> writes:

> What is your gnus-summary-prepare-exit-hook set to?

Value: (gnus-picons-kill-buffer gnus-summary-expire-articles)

But, as I mentioned in my previous message, even C-c C-x, or C-c C-M-x
doesn't expire any articles...

-- 
Josh Huber



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

* Re: expiry problems?
  2001-11-09 18:09   ` Josh Huber
@ 2001-11-09 19:17     ` Matt Armstrong
  2001-11-09 23:00       ` Josh Huber
  0 siblings, 1 reply; 10+ messages in thread
From: Matt Armstrong @ 2001-11-09 19:17 UTC (permalink / raw)


Josh Huber <huber@alum.wpi.edu> writes:

> "Matt Armstrong" <matt+dated+1007916971.1436bf@lickey.com> writes:
>
>> What is your gnus-summary-prepare-exit-hook set to?
>
> Value: (gnus-picons-kill-buffer gnus-summary-expire-articles)
>
> But, as I mentioned in my previous message, even C-c C-x, or C-c C-M-x
> doesn't expire any articles...

Weird.

This is usually when I start making use of edebug-defun.  ;-)


-- 
matt



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

* Re: expiry problems?
  2001-11-09 19:17     ` Matt Armstrong
@ 2001-11-09 23:00       ` Josh Huber
  2001-11-10 11:11         ` Simon Josefsson
  0 siblings, 1 reply; 10+ messages in thread
From: Josh Huber @ 2001-11-09 23:00 UTC (permalink / raw)


"Matt Armstrong" <matt+dated+1007925443.50f781@lickey.com> writes:

> This is usually when I start making use of edebug-defun.  ;-)

indeed.  after my first use of edebug, I've decided that it rocks :)

I did manage to make xemacs segfault with it though :P

What I realized, after tracing functions about 5 levels deep, is that
the nnmail-expired-article-p function was returning nil for some
articles that are older than 7 days.

I noticed that it sorts the articles by number, then looks for the
is-old parameter to turn false, at which point it doesn't check
anymore.

This is fine, except for the fact that the nnmail-expired-article-p
function returns nil for VERY old articles.

because of this piece of code:

(time-less-p days (time-since time))

time-since returns a negative number for articles before 1970...

touch -d "Jan 1 1940" <first article in nnml directory>

and your articles will never be expired in that group.

My clock must have been set wrong while those messages were created,
and they're in each group I have keeping everything from being
expired.

anyway, here is my fix, should I commit?  I'm asking since it really
seems like a hack.  The real fix is probably to time-since...

Index: ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 6.844
diff -u -r6.844 ChangeLog
--- ChangeLog	2001/11/09 21:58:45	6.844
+++ ChangeLog	2001/11/09 22:59:04
@@ -1,3 +1,8 @@
+2001-11-09  Josh Huber  <huber@alum.wpi.edu>
+
+	* nnmail.el (nnmail-expired-article-p): Add case for files older
+	than 1970.
+
 2001-11-09  Simon Josefsson  <jas@extundo.com>
 
 	* gnus.el (gnus-local-domain): Fix doc.  From Pavel Janík
Index: nnmail.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmail.el,v
retrieving revision 6.27
diff -u -r6.27 nnmail.el
--- nnmail.el	2001/09/26 17:55:05	6.27
+++ nnmail.el	2001/11/09 22:59:04
@@ -1687,7 +1687,12 @@
 	    ((numberp days)
 	     (setq days (days-to-time days))
 	     ;; Compare the time with the current time.
-	     (ignore-errors (time-less-p days (time-since time))))))))
+	     (let ((since (time-since time)))
+	       (ignore-errors
+		 ;; if time-since returns a negative value the date is
+		 ;; before 1970, and is obviouly ready to expire.
+		 (or (> 0 (car since))
+		     (time-less-p days since)))))))))
 
 (defun nnmail-expiry-target-group (target group)
   ;; Do not invoke this from nntp-server-buffer!  At least nnfolder clears


-- 
Josh Huber



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

* Re: expiry problems?
  2001-11-09 23:00       ` Josh Huber
@ 2001-11-10 11:11         ` Simon Josefsson
  2001-11-10 17:52           ` Josh Huber
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Josefsson @ 2001-11-10 11:11 UTC (permalink / raw)


Josh Huber <huber@alum.wpi.edu> writes:

> This is fine, except for the fact that the nnmail-expired-article-p
> function returns nil for VERY old articles.
>
> because of this piece of code:
>
> (time-less-p days (time-since time))
>
> time-since returns a negative number for articles before 1970...
>
> touch -d "Jan 1 1940" <first article in nnml directory>
>
> and your articles will never be expired in that group.
>
> My clock must have been set wrong while those messages were created,
> and they're in each group I have keeping everything from being
> expired.
>
> anyway, here is my fix, should I commit?  I'm asking since it really
> seems like a hack.  The real fix is probably to time-since...

I don't grok what is happening, the functions seems to handle negative
dates for me:

(time-less-p (days-to-time 7)
             (time-since (date-to-time "Jan 1 00:00:00 1940")))
t

Can you provide some more info on which values you see?




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

* Re: expiry problems?
  2001-11-10 11:11         ` Simon Josefsson
@ 2001-11-10 17:52           ` Josh Huber
  2001-11-10 19:04             ` Simon Josefsson
  0 siblings, 1 reply; 10+ messages in thread
From: Josh Huber @ 2001-11-10 17:52 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> (time-less-p (days-to-time 7)
>              (time-since (date-to-time "Jan 1 00:00:00 1940")))
> t

This returns nil for me.  Maybe it's an XEmacs bug?  I see you're
running emacs21...

(time-less-p (days-to-time 7)
             (time-since (date-to-time "Jan 1 00:00:00 1969")))
nil

(time-less-p (days-to-time 7)
             (time-since (date-to-time "Jan 1 00:00:00 1970")))
t       

ttyl,

-- 
Josh Huber



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

* Re: expiry problems?
  2001-11-10 17:52           ` Josh Huber
@ 2001-11-10 19:04             ` Simon Josefsson
  2001-11-21  6:32               ` Stephen J. Turnbull
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Josefsson @ 2001-11-10 19:04 UTC (permalink / raw)


Josh Huber <huber@alum.wpi.edu> writes:

>> (time-less-p (days-to-time 7)
>>              (time-since (date-to-time "Jan 1 00:00:00 1940")))
>> t
>
> This returns nil for me.  Maybe it's an XEmacs bug?  I see you're
> running emacs21...

Yes.  The patch below fixes it, someone at xemacs-patches please have
a look at it.

XEmacs 21.1, 21.4 (without patch):

(encode-time 0 0 1 1 1 1969 nil nil 3600)
(65054 52352)

Emacs 20.7, 21.1 (and XEmacs 21.4 with patch):

(encode-time 0 0 1 1 1 1969 nil nil 3600)
(-482 52352)

2001-11-10  Simon Josefsson  <jas@extundo.com>

	* editfns.c (make_time): New function, from Emacs.
	(Fencode_time): Use it, instead of `wasteful_word_to_lisp'.

--- editfns.c.~1.27.2.2.~	Wed Nov  7 20:43:02 2001
+++ editfns.c	Sat Nov 10 19:57:27 2001
@@ -1176,6 +1176,14 @@
 
 static void set_time_zone_rule (char *tzstring);
 
+Lisp_Object
+make_time (time)
+     time_t time;
+{
+  return Fcons (make_int (time >> 16),
+		Fcons (make_int (time & 0177777), Qnil));
+}
+
 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /*
   Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
 This is the reverse operation of `decode-time', which see.
@@ -1249,7 +1257,7 @@
   if (the_time == (time_t) -1)
     error ("Specified time is not representable");
 
-  return wasteful_word_to_lisp (the_time);
+  return make_time (the_time);
 }
 
 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*




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

* Re: expiry problems?
  2001-11-10 19:04             ` Simon Josefsson
@ 2001-11-21  6:32               ` Stephen J. Turnbull
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen J. Turnbull @ 2001-11-21  6:32 UTC (permalink / raw)
  Cc: xemacs-beta, ben, hniksic

>>>>> "Simon" == Simon Josefsson <jas@extundo.com> writes:

    Simon> Yes.  The patch below fixes it, someone at xemacs-patches
    Simon> please have a look at it.

    Simon> XEmacs 21.1, 21.4 (without patch):

    Simon> (encode-time 0 0 1 1 1 1969 nil nil 3600)
    Simon> (65054 52352)

wasteful_word_to_lisp() is required to produce this result by the C
standard.

    Simon> Emacs 20.7, 21.1 (and XEmacs 21.4 with patch):

    Simon> (encode-time 0 0 1 1 1 1969 nil nil 3600)
    Simon> (-482 52352)

This result is plausible, but the C standard does not require GNU's
make_time to produce it AFAIK.

For XEmacs 21.4.6, I'm going to (1) use GNU's make_time(), but divide
by 2^16 when time is negative to guarantee the desired result (how
Martinesque), and (2) eliminate use of (wasteful_)?word_to_lisp() to
decode time (only in dired.c).

Comments?

Simon's patch follows in full for those who just joined us.  The
semantic difference between Simon's version and the current XEmacs
code can be summarized by "s/time_t/unsigned int/".

2001-11-10  Simon Josefsson  <jas@extundo.com>

	* editfns.c (make_time): New function, from Emacs.
	(Fencode_time): Use it, instead of `wasteful_word_to_lisp'.

--- editfns.c.~1.27.2.2.~	Wed Nov  7 20:43:02 2001
+++ editfns.c	Sat Nov 10 19:57:27 2001
@@ -1176,6 +1176,14 @@
 
 static void set_time_zone_rule (char *tzstring);
 
+Lisp_Object
+make_time (time)
+     time_t time;
+{
+  return Fcons (make_int (time >> 16),
+		Fcons (make_int (time & 0177777), Qnil));
+}
+
 DEFUN ("encode-time", Fencode_time, 6, MANY, 0, /*
   Convert SECOND, MINUTE, HOUR, DAY, MONTH, YEAR and ZONE to internal time.
 This is the reverse operation of `decode-time', which see.
@@ -1249,7 +1257,7 @@
   if (the_time == (time_t) -1)
     error ("Specified time is not representable");
 
-  return wasteful_word_to_lisp (the_time);
+  return make_time (the_time);
 }
 
 DEFUN ("current-time-string", Fcurrent_time_string, 0, 1, 0, /*



-- 
Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
              Don't ask how you can "do" free software business;
              ask what your business can "do for" free software.



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

end of thread, other threads:[~2001-11-21  6:32 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-09 14:32 expiry problems? Josh Huber
2001-11-09 15:53 ` Harry Putnam
2001-11-09 16:56 ` Matt Armstrong
2001-11-09 18:09   ` Josh Huber
2001-11-09 19:17     ` Matt Armstrong
2001-11-09 23:00       ` Josh Huber
2001-11-10 11:11         ` Simon Josefsson
2001-11-10 17:52           ` Josh Huber
2001-11-10 19:04             ` Simon Josefsson
2001-11-21  6:32               ` Stephen J. Turnbull

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).