Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] Possible problem with maildir ID generation
@ 2009-04-16 22:05 Mark Alexander
  2009-04-21 14:00 ` William Morgan
  0 siblings, 1 reply; 8+ messages in thread
From: Mark Alexander @ 2009-04-16 22:05 UTC (permalink / raw)


I've been studying maildir.rb (and adding some debug code) while
trying to figure out my lost message problem.  I think there may be a
problem with the way the internal message IDs are generated.  The
make_id method glues together the file timestamp and size.  But I
think this could lead to an out-of-order problem in the @ids array.

Consider two messages that arrive in the same second, but the second
message is smaller than the first.  Because the message size makes up
the low seven (decimal) digits of the ID, the second message, even
though it arrived later, will have an ID that is less than the first
message.

Then suppose that sup polls the maildir directory after the first
message arrives, but before the second message arrives, and sets the
cur_offset to the ID of the first message.  Then, the next time it
polls, it will see the second message, but because its ID is less than
that of the first message, it will appear before the first in the @ids
array after it is sorted.  So then the each method will skip the
second message, because cur_offset (the ID of the first message) will
be found in @ids after it.

Does this scenario make sense?  I have seen what appears to be one
instance of this happening, though I'm still watching closely and
adding more debugging code to make sure that it explains all of the
lost messages.


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

end of thread, other threads:[~2009-05-04 17:24 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-16 22:05 [sup-talk] Possible problem with maildir ID generation Mark Alexander
2009-04-21 14:00 ` William Morgan
2009-04-21 15:33   ` Mark Alexander
     [not found]   ` <20090428191822.GB10581@cabinet.hsd1.ma.comcast.net>
2009-04-28 23:29     ` Mark Alexander
2009-04-29 22:31       ` William Morgan
2009-04-29 22:39         ` William Morgan
     [not found]         ` <20090429233820.GA14143@cabinet.hsd1.ma.comcast.net>
2009-05-04 16:10           ` William Morgan
     [not found]             ` <20090504165224.GA15815@cabinet.hsd1.ma.comcast.net>
2009-05-04 17:24               ` Mark Alexander

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