Subject: Re: [sup-devel] [PATCH] prevent "year too big to marshal" crashes

From: Rich Lane <[email-masked]>
Date: Sat, 27 Feb 2010 02:48:52 -0500

Applied to master.
_______________________________________________
Sup-devel mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-devel

---

From: Eric Sherman <[email-masked]>
Date: Fri, 05 Feb 2010 11:19:03 -0500

Xapian::Document#entry= performs a Marshal.dump which was throwing a
"year too big to marshal" when adding a new message.  I just
truncate_date'd the message's date when the entry hash is created in
sync_message and this problem went away for me.

It was a spam message, as the MIN_DATE/MAX_DATE comments hinted.
---
 lib/sup/xapian_index.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index 443b88d..44531a2 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -435,7 +435,7 @@ EOS
       :message_id => m.id,
       :source_id => m.source.id,
       :source_info => m.source_info,
-      :date => m.date,
+      :date => truncate_date(m.date),
       :snippet => snippet,
       :labels => m.labels.to_a,
       :from => [m.from.email, m.from.name],
-- 
1.6.6