It appears that the issue restoring a session is a problem with our marshalling implementation. The following code fails to work:

class MyHash < Hash
  def foo; end
end

x = MyHash.new
Marshal.load (Marshal.dump(x)).foo

The MyHash is getting marshalled and unmarshalled as though it were a simple hash. The results of marshalling in both Ruby and JRuby:

Ruby: "\004\010C:\vMyHash{\000"
JRuby: "\004\n{\000"

I'm going to see if I can dig up a binary spec for Ruby marshalling.

On 4/14/06, Charles O Nutter <[EMAIL PROTECTED] > wrote:
I found the issue with establishing a new session deep in the bowels of RubyIO, called by FileUtils, called by PStore, called by CGI::Session, called by Rails...

IO#read returns different values for EOF according to how it's called. If called with a bare arg list, it returns "". If called with a Fixnum, it returns nil. Because we had it always returning "" a copy loop in FileUtils was looping forever.

With the fix, Rails is able to establish a new session (yay!) but recalling that session on a subsequent request blows up (boo!). So it's another step along, and IO#read is closer to correct.

--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com



--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com

Reply via email to