Archive of RubyForge sup-devel mailing list
 help / color / mirror / Atom feed
From: Eric Sherman <hyperbolist@gmail.com>
To: sup-devel <sup-devel@rubyforge.org>
Subject: [sup-devel] [PATCH] prevent "year too big to marshal" crashes
Date: Fri, 05 Feb 2010 11:19:03 -0500	[thread overview]
Message-ID: <1265386698-sup-8060@changeling.local> (raw)

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

_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel


             reply	other threads:[~2010-02-05 16:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-05 16:19 Eric Sherman [this message]
2010-02-27  7:48 ` Rich Lane

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=1265386698-sup-8060@changeling.local \
    --to=hyperbolist@gmail.com \
    --cc=sup-devel@rubyforge.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