This project is archived and is in readonly mode.
Integrate support for Dalli
-
Rohit Arondekar
- Importance changed from to Low
I think this is better suited for the core mailing list: http://groups.google.com/group/rubyonrails-core
-
Mike Perham
I'm working on a patch to do the work. One issue I have found is that the increment/decrement operations are not backwards compatible. This is not a Dalli limitation but due to a change in the memcached binary protocol. Counters can no longer be initialized with set() and read with get(). They are 64-bit integers which can only be accessed with the incr/decr operations.
I will hopefully have a first pass at the patch later this week.
-
Jeremy Kemper
- Milestone cleared.
- State changed from new to open
- Assigned user set to Jeremy Kemper
-
Mike Perham
My comments about increment/decrement were wrong. Further investigation found a bug in my code. So it goes.
Here's a patch which deprecates :mem_cache_store when used with memcache-client. Since :mem_cache_store also supports fauna's memcached gem I didn't deprecate the entire class, just that codepath.
The dalli_store test is identical to the mem_cache_store test and passes 100%.
My goal is to make Dalli the new recommended production cache store in Rails 3.1. Please let me know if I can help with any bug, documentation or other changes to that end.
-
Ryan Bigg
Automatic cleanup of spam.
-
Aaron Gibralter
Any plans to replace http://github.com/rails/rails/blob/v3.0.1/actionpack/lib/action_dis... as well?
-
Aaron Gibralter
Also, Mike, does Dalli open and keep open sockets to the memcache server during Rails initialization like the old memcache store? I'm just trying to wrangle a few tickets here... it would be great if Dalli as a session store didn't have the same issues as the old session/mem_cache_store: https://rails.lighthouseapp.com/projects/8994/tickets/2644-memcache...
-
Mike Perham
Dalli packages a dalli_store adapter for ActiveSupport. I'd guess that the Rails core is trying to move away from shipping adapters for specific gems - I'm ok with dalli_store remaining in the dalli gem itself but you can pull it into active_support if you'd like.
And Dalli connects lazily to memcached. It will not open a socket until the code performs an actual operation. I also include a Dalli::Client#reset method that can be used in the Passenger fork event if necessary but it should only be needed in special cases.
-
Aaron Gibralter
Could a new Dalli-based session store also address the session fixation issue: https://rails.lighthouseapp.com/projects/8994/tickets/3134-memcache...
(Sorry for all the messages! Should have thought this all through before submitting.)
-
Mike Perham
That session ID bug looks like something that might be endemic to all session store providers and should be fixed generically. My general policy is to stay as compatible as possible with the mem_cache_store version - even if that means reproducing bugs. If Rails fixes mem_cache_store, I'll update dalli_store with the same fix.
-
Aaron Gibralter
Yeah makes sense. I just think that Rails should deprecate and then gut the existing mem_cache_store (for activesupport and actionpack's sessions). Rails should ship with CookieStore and ActiveRecordStore... If someone wants memcache support, she can use dalli_store; and if she wants redis support, she can use redis-store -- it is as easy as putting the gems in her Gemfile.
-
Jeff Kreeftmeijer
Automatic cleanup of spam.
-
Santiago Pastorino
- Milestone set to 3.1
-
Santiago Pastorino
Mike we were talking with Jeremy and Aaron and we come up with this ...
"I just think that Rails should deprecate and then gut the existing mem_cache_store (for activesupport and actionpack's sessions). Rails should ship with CookieStore and ActiveRecordStore... If someone wants memcache support, she can use dalli_store; and if she wants redis support, she can use redis-store -- it is as easy as putting the gems in her Gemfile."
What do you think?
-
Mike Perham
Sounds fine to me. You are welcome to point people to Dalli and :dalli_store in the deprecation warning.
-
rails
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
rails
- State changed from open to stale
-
Santiago Pastorino
- State changed from stale to open
