Kamil Kukura
2007-Oct-08 20:45 UTC
Fix for MemCacheStore forgetting sessions when running in cluster
I was sick seeing that when using memcache for storing sessions, they are suddenly disappearing when used in cluster environment. Users were randomly logged out, orders in shopping cart emptied and so on... I examined CGI::Session::MemCacheStore a little bit and found out there is missing "add" call for the backend as there are only further updates, and MemCache#set has this "Warning: Readers should not call this method in the event of a cache miss; see MemCache#add." After the patch below has been applied, the problem of disappearing sessions is gone in my production environment. I deleted all those silent discards of exceptions to let any problem emerge. I also wrote couple of tests because there was no test case for this store. These tests are skipped when memcache gem or server connection is not available. The patch is in ticket http://dev.rubyonrails.org/ticket/9823 -- Kamil Kukura --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegroups.com To unsubscribe from this group, send email to rubyonrails-core-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en -~----------~----~----~----~------~----~------~--~---