rack-devel archive mirror (unofficial) https://groups.google.com/group/rack-devel
 help / color / mirror / Atom feed
* Threading Bug Causing Corrupted File Response
@ 2010-01-26  3:44 Sunny Hirai
  2010-01-26  3:53 ` Sunny Hirai
  0 siblings, 1 reply; 5+ messages in thread
From: Sunny Hirai @ 2010-01-26  3:44 UTC (permalink / raw)
  To: Rack Development

There appears to be a threading related bug where if you try and load
the same file twice at the same time, you get an error that flashes in
Firefox before displaying the image that says:

  The image "path/to/image.png" cannot be displayed, because it
contains errors.

Since this was working before, I'm guessing the bug was introduced in
1.1 or at least a recent-ish release (not exactly sure when the bug
crawled in).

Although I was using a custom file mapper, this bug still happens in
Rack's file mapper. I can replicate by doing:

app = Rack::Builder.new do
  run Rack::File.new( '.' )
end

If I hit the file twice quickly, Firefox will flash the error. It will
retry immediately so the image eventually comes up but there are twice
as many requests made.

The bug can be replicated using both Mongrel and WEBrick.

Sunny Hirai

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

end of thread, other threads:[~2010-01-28 11:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26  3:44 Threading Bug Causing Corrupted File Response Sunny Hirai
2010-01-26  3:53 ` Sunny Hirai
2010-01-26  4:10   ` Sunny Hirai
2010-01-28  1:22     ` Sunny Hirai
2010-01-28 11:27       ` James Tucker

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 read-only IMAP folder(s) and NNTP newsgroup(s).