Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Race condition in ActionController::Caching::Pages

#6773

Using JRuby 1.6.0, we saw a corrupt file created by Rails' page caching. It appeared that multiple threads were able to write simultaneously to a cache file.

We were able to duplicate the behavior we saw with the following contrived example:

f1 = File.open("out", "wb+")
f2 = File.open("out", "wb+")

10000.times do
  f1.write "a"
  f2.write "b"
end

f2.close
f1.close

This results with a file with interleaved "a" and "b" characters.

I'm not sure if this behavior occurs across processes as well, but it's likely to be much more prevalent in a multi-threaded program.

Reported by Stephen Judkins · May 11th, 2011 @ 02:05 AM

State: new
Milestone: none
Assigned to: nobody
Importance: none

Activity

No comments yet.