Broken pipe error in rails with memcached

纵饮孤独 提交于 2019-12-10 10:58:33

问题


I keep running into this error MemCacheError (Broken pipe): Broken pipe on my Rails app and I can't figure out why.

When I access memcached via Rails.cache in my controller, the first 1 or 2 read/writes always seems to throw the broken pipe error. But when I access memcached by creating a new object, ActiveSupport::Cache::MemCacheStore.new, I don't seem to get this error.

I also access memcached in another ruby process, and the first read always has this error regardless of the way I access memcached. I did implement a work around just by retrying the read but id rather have a better long term solution.

Currently the only time I see this problem is after I restart memcached. I'm using Rails 2.3.5 and memcached 1.4.4 (I've also tried this with memcached 1.2.2).


回答1:


I believe this error occurs when you restart memcached while the rails app is still running. If you restart mongrel or the rails app in passenger after you restart memcached, you shouldn't see this problem.



来源:https://stackoverflow.com/questions/2529296/broken-pipe-error-in-rails-with-memcached

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!