Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] more xapian/label woes
@ 2009-09-04  2:13 Ben Walton
  2009-09-04 15:30 ` William Morgan
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Walton @ 2009-09-04  2:13 UTC (permalink / raw)



Hi All,

I've tried the xapian conversion again and am now back in ferret
land.  In this case, I don't think the issues are xapian related...it
seems to the labels that are biting me again.

I get exceptions with non-Symbol labels being passed around again.  To
finish the import of my ferret dumpfile, I had to do the following:

--snip--
diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index 1395601..4b3b022 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -111,7 +111,7 @@ class XapianIndex < BaseIndex
       :replytos => (entry[:replytos] || m.replytos),
     }
 
-    labels.each { |l| LabelManager << l }
+    labels.each { |l| LabelManager << l.to_sym }
--snip--

This got me to the point where I could fire up sup with
SUP_INDEX=xapian, but the initial poll caused the attached exception.
I wonder if LabelManager should simply call .to_sym (.intern) on
everything passed to it?  That's a big hammer, I realize...maybe
.to_sym/.intern in cases where the unexpected object is a String?

Thoughts?

Thanks
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: exception-log.txt
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090903/48d07caf/attachment.txt>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090903/48d07caf/attachment.bin>


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

* [sup-talk] more xapian/label woes
  2009-09-04  2:13 [sup-talk] more xapian/label woes Ben Walton
@ 2009-09-04 15:30 ` William Morgan
  2009-09-04 20:47   ` Ben Walton
  0 siblings, 1 reply; 3+ messages in thread
From: William Morgan @ 2009-09-04 15:30 UTC (permalink / raw)


Reformatted excerpts from Ben Walton's message of 2009-09-03:
> I get exceptions with non-Symbol labels being passed around again.  To
> finish the import of my ferret dumpfile, I had to do the following:

Is this with a recent next, and after deleting any vestigal
~/.sup/xapian directory and .db files? If so, there really shouldn't be
any label issues. If there are, can you attach the original exception?
Also, does your sources.yaml file have something weird for labels?

> This got me to the point where I could fire up sup with
> SUP_INDEX=xapian, but the initial poll caused the attached exception.
> I wonder if LabelManager should simply call .to_sym (.intern) on
> everything passed to it?

Certainly an option, but I'm hoping to keep the "fail fast" behavior for
now since it is revealing underlying problems.
-- 
William <wmorgan-sup at masanjin.net>


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

* [sup-talk] more xapian/label woes
  2009-09-04 15:30 ` William Morgan
@ 2009-09-04 20:47   ` Ben Walton
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Walton @ 2009-09-04 20:47 UTC (permalink / raw)


Excerpts from William Morgan's message of Fri Sep 04 11:30:11 -0400 2009:

> Is this with a recent next, and after deleting any vestigal
> ~/.sup/xapian directory and .db files? If so, there really shouldn't be
> any label issues. If there are, can you attach the original exception?
> Also, does your sources.yaml file have something weird for labels?

It was with cdb1017, but I likely did have a ~/.sup/xapian directory
from previous attempts.  I'll try again tonight with that cleared out.

> > This got me to the point where I could fire up sup with
> > SUP_INDEX=xapian, but the initial poll caused the attached exception.
> > I wonder if LabelManager should simply call .to_sym (.intern) on
> > everything passed to it?
> 
> Certainly an option, but I'm hoping to keep the "fail fast" behavior for
> now since it is revealing underlying problems.

Ok, I think this is likely the best approach too.  Strings and symbols
have a somewhat special relationship in ruby though, so I thought it
might be ok to force a coercion in that case.  Lets make it the last
resort as you suggest.

Thanks
-Ben
-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20090904/aa7e19d8/attachment.bin>


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

end of thread, other threads:[~2009-09-04 20:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-04  2:13 [sup-talk] more xapian/label woes Ben Walton
2009-09-04 15:30 ` William Morgan
2009-09-04 20:47   ` Ben Walton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox