#111 ✓resolved
mayoral

ActiveRecord session store not creating new records with Thin 1.2.4 and Rails 2.2.2

Reported by mayoral | September 7th, 2009 @ 04:41 AM | in Future

When updated to Thin 1.2.4, session store stops creating new session records in the database in an app with Rails 2.2.2. If i revert to Thin 1.2.2 the app starts again to record sessions in the database.

Another app with almost the same code and Rails 2.3.4 seems not to be afected by this behaviour in Thin 1.2.4.

Comments and changes to this ticket

  • macournoyer

    macournoyer September 7th, 2009 @ 04:19 PM

    Is there any error in Rails log or thin.log ?

  • macournoyer

    macournoyer September 10th, 2009 @ 10:19 AM

    • State changed from “new” to “open”

    I cannot reproduce, can you post your environment.rb or the where your configure the session store (don't forget to hide the secret key).

    Are you using Ruby 1.8.7?

    What changed in 1.2.4 is that Thin now uses Rails Rack base interface if available. Maybe that is causing the issue.

  • macournoyer

    macournoyer September 10th, 2009 @ 10:53 AM

    Ah! 2.2.2 IS rack based, I guess it's broken or was not complete. I'll try to refine the logic to check when to use the Rack-base interface: http://github.com/macournoyer/thin/blob/66bd68c2faccad3e5d5b5de48e2...

  • macournoyer

    macournoyer October 7th, 2009 @ 08:41 PM

    Can you try w/ this patch and let me know if it fixes it?
    I tested w/ Rails 2.3.2 and it worked.

    diff --git a/lib/rack/adapter/rails.rb b/lib/rack/adapter/rails.rb
    index 8e5fd81..24c3c06 100644
    --- a/lib/rack/adapter/rails.rb
    +++ b/lib/rack/adapter/rails.rb
    @@ -32,9 +32,7 @@ module Rack
           end
           
           def rack_based?
    -        ActionController.const_defined?(:Dispatcher) &&
    -          (ActionController::Dispatcher.instance_methods.include?(:call) ||
    -           ActionController::Dispatcher.instance_methods.include?("call"))
    +        Rails::VERSION::MAJOR >= 2 && Rails::VERSION::MINOR >= 3 && Rails::VERSION::TINY >= 2
           end
           
           def load_application
    
  • macournoyer

    macournoyer October 8th, 2009 @ 08:00 AM

    Oops, this one should work for real now:

    diff --git a/lib/rack/adapter/rails.rb b/lib/rack/adapter/rails.rb
    index 8e5fd81..24c3c06 100644
    --- a/lib/rack/adapter/rails.rb
    +++ b/lib/rack/adapter/rails.rb
    @@ -32,9 +32,7 @@ module Rack
           end
           
           def rack_based?
    -        ActionController.const_defined?(:Dispatcher) &&
    -          (ActionController::Dispatcher.instance_methods.include?(:call) ||
    -           ActionController::Dispatcher.instance_methods.include?("call"))
    +        ::Rails::VERSION::MAJOR >= 2 && ::Rails::VERSION::MINOR >= 3 && ::Rails::VERSION::TINY >= 2
           end
           
           def load_application
    
  • macournoyer

    macournoyer October 13th, 2009 @ 10:26 PM

    • State changed from “open” to “resolved”

    (from [b16e72ff779d9c077d24462666d4a5487449627c]) Ensure Rack base API is used in Rails adapter only if version >= 2.3.2 [#111 state:resolved] http://github.com/macournoyer/thin/commit/b16e72ff779d9c077d2446266...

  • macournoyer

    macournoyer November 5th, 2009 @ 09:54 AM

    This should be fixed in version 1.2.5 deployed yesterday on gemcutter.org

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Referenced by

Pages