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.

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

#111

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.

Reported by mayoral · September 7th, 2009 @ 04:41 AM

State: resolved
Milestone: Future
Assigned to: macournoyer macournoyer

Activity

  1. macournoyer
    macournoyer

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

    September 7th, 2009 @ 04:19 PM

  2. macournoyer
    macournoyer
    • 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.

    September 10th, 2009 @ 10:19 AM

  3. macournoyer
    macournoyer

    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...

    September 10th, 2009 @ 10:53 AM

  4. macournoyer
    macournoyer

    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
    

    October 7th, 2009 @ 08:41 PM

  5. macournoyer
    macournoyer

    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
    

    October 8th, 2009 @ 08:00 AM

  6. macournoyer
  7. macournoyer
    macournoyer

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

    November 5th, 2009 @ 09:54 AM

  8. John
    John

    Onestamente, sono pochi i casinò che offrono grandi bonus. Se dai un'occhiata al Winnita Casinò casinò ti assicurerai che è qualcosa che può aiutarti a smettere di fare il lavoro che odi. Se vuoi lasciare il tuo lavoro e guadagnarti da vivere giocando al casinò, è la scelta https://winnitacasino-it.com/ migliore!

    April 9th, 2024 @ 11:00 AM

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.