-
Notifications
You must be signed in to change notification settings - Fork 452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined method `dup_value!' with dalli 2.7.11 and rails 6.1 #771
Comments
@roccoblues So Dalli 2.x wasn't validated against Rails 6.1. Is there a reason you don't want to use MemCacheStore? |
Hi @petergoldstein, we're using an internal gem that builds on DalliStore. We tried to switch that to MemCacheStore but had to rollback due to a huge increase (allocated bytes doubled) in allocations when we switched. We haven't investigated further but the theory is that that comes from the fact that MemCacheStore wraps every cache data into an additional |
DalliStore isn't supported in Rails 6.1 or Dalli 3.0; see petergoldstein/dalli#771.
This fixes an issue where the Dalli store is not supported in Rails 6.1: petergoldstein/dalli#771
This fixes an issue where the Dalli store is not supported in Rails 6.1: petergoldstein/dalli#771
This fixes an issue where the Dalli store is not supported in Rails 6.1: petergoldstein/dalli#771
I am having this same problem. Switching to the mem_cache_store in the mean time. |
Also running into this during a Rails 6.1 upgrade and didn't discover it until we got it out on our staging server. @petergoldstein should there be a 2.7.12 released that is pinned to Rails < 6.1 ? And then maybe 2.8 can introduce 6.1 compat? Relative stack trace here, coming from a
|
Having the same problem with rails 6.1.3 EDIT: Can anyone elaborate on what's the plan for this bug? It is preventing us from upgrading to rails 6 and dalli_store is a cornerstone of our sytem. I noticed that dalli 3.0 is going to deprecate dalli_store so is this bug even planned to be fixed in <= 2.X.X? |
Dalli store is not supported in Rails 6.1: petergoldstein/dalli#771 The fix is to swap out for MemCacheStore, as we've done here: alphagov/local-links-manager#751 Without this change, a write to the cache causes this exception: ``` NoMethodError undefined method `dup_value!' for #<String:0x00007f9cf66fb130> ``` That said, we still need the dalli gem, otherwise we get this error: ``` Could not find cache store adapter for mem_cache_store (cannot load such file -- dalli) /app/config/environment.rb:5:in `<top (required)>' ```
For anyone having this problem:
If you are using identity_cache on the latest tag, there is a bugfix in this commit mperham/connection_pool@97b2698 right above the top tag. it is related to the connection_pool configuration. |
We had this issue happen after switching to the |
There's a bug in the Mem Cache Store on 6.1, I haven't confirmed if it exists on `main` too (since rails#42025). We came across the bug when upgrading an app from 6.0 to 6.1 that had recently switched from the `dalli_store` to the `mem_cache_store`. petergoldstein/dalli#771 seems similar, but in our case it's specifically to do with caching the value `false`. To replicate: - Open a Rails console with the `dalli_store` enabled. - `Rails.cache.write "test", false` - Open another Rails console, with the `mem_cache_store` enabled. - Enable the local cache (starting a Rails server would also achieve this): `ActiveSupport::Cache::Strategy::LocalCache::LocalCacheRegistry.set_cache_for(Rails.cache.send(:local_cache_key), ActiveSupport::Cache::Strategy::LocalCache::LocalStore.new)` - ` Rails.cache.fetch("test") { false }` It will crash with `NoMethodError (undefined method `dup_value!' for false:FalseClass)`. The fix is to convert any entry into an `Entry`, even if it's `nil` or `false`.
This fixes an issue where the Dalli store is not supported in Rails 6.1: petergoldstein/dalli#771, cf. alphagov/local-links-manager#751 and alphagov/collections#2287
This fixes an issue where the Dalli store is not supported in Rails 6.1: petergoldstein/dalli#771, cf. alphagov/local-links-manager#751 and alphagov/collections#2287
Saw this when using |
@ghiculescu Now that your fix in Rails is merged, is there anything additional to be fixed in Dalli to address this issue? |
My issue wasn’t exactly the same as OP’s, but no, my gut feel is this issue can be resolved. @byroot and I shipped a few rails PRs for backward compat around the local cache. |
@alexisraca Apologies for the late reply, but we're not planning to do any additional support work for Are all your post-switch issues resolved, or do you believe additional items need to be fixed in Dalli? |
@petergoldstein Everything is cool now. The fixes posted in my last comment solved everything. There was a bug in our implementation with |
Thanks @alexisraca . Closing this issue. |
A simple
Rails.cache.write
with:dalli_store
and Rails 6.1 leads toundefined method
dup_value!'`.I tracked it down to this commit in rails: rails/rails@9b09187#diff-ec46f57f15b817f91efebde97d0e74edfc656ada553296cecdf09a9611d95bf5
There was also an issue opened in rails reporting the same problem: rails/rails#40869
Is dalli 2.x supposed to support rails 6.1?
The text was updated successfully, but these errors were encountered: