Skip to content
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

Memcached, Stale Cache & Config Problem #350

Open
blj opened this issue Nov 12, 2012 · 4 comments
Open

Memcached, Stale Cache & Config Problem #350

blj opened this issue Nov 12, 2012 · 4 comments

Comments

@blj
Copy link
Collaborator

blj commented Nov 12, 2012

I use memcahced server to help radiant to store the output. Unfortunately, I got this error randomly and the website stops working. Even when I did script/console it would come with this error:

/app/models/radiant/config.rb:84:in []':NoMethodError: undefined method[]' for nil:NilClass

The line that is being thrown error is :Rails.cache.read('Radiant::Config')[key].

So I restarted memcached server and then the error disappeared. I wonder whether Radiant has cached something and if it is no longer returned by the cache server, instead of fallback it throws the above error.

@jfahrenkrug
Copy link
Member

Are you using the dalli gem to talk to memcached?

@blj
Copy link
Collaborator Author

blj commented Feb 6, 2013

Yes I am using dalli gem.

@jfahrenkrug
Copy link
Member

Interesting. Does your log say something? Did the memcached server possibly freeze or crash because of too long keys or values? Also, are you using Passenger? If so, adding this to your environment.rb might help:

if defined?(PhusionPassenger)
  PhusionPassenger.on_event(:starting_worker_process) do |forked|
    # Only works with DalliStore
    Rails.cache.reset if forked
  end
end

@blj
Copy link
Collaborator Author

blj commented Feb 6, 2013

I did not check the log. I do not think the memcached server froze, it was
working with other software. I already have that part in my production.rb.
It certainly did not help.

On Wed, Feb 6, 2013 at 5:30 PM, Johannes Fahrenkrug <
notifications@github.com> wrote:

Interesting. Does your log say something? Did the memcached server
possibly freeze or crash because of too long keys or values? Also, are you
using Passenger? If so, adding this to your environment.rb might help:

if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
# Only works with DalliStore
Rails.cache.reset if forked
end
end


Reply to this email directly or view it on GitHubhttps://github.com//issues/350#issuecomment-13178786.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants