使用Memcached的Rails中的管道错误 [英] Broken pipe error in rails with memcached

查看:100
本文介绍了使用Memcached的Rails中的管道错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直遇到此错误 MemCacheError(管道断开):管道破裂,但我不知道为什么.

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

当我在控制器中通过Rails.cache访问memcached时,前1或2次读/写操作似乎总是抛出管道中断错误.但是,当我通过创建新对象ActiveSupport::Cache::MemCacheStore.new访问memcached时,似乎没有收到此错误.

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.

我也在另一个ruby进程中访问memcached,并且无论我访问memcached的方式如何,第一次读取始终会出现此错误.我确实通过重试读取但id来实现一项工作,而是拥有一个更好的长期解决方案.

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.

当前,我唯一看到此问题的时间是在重新启动memcached之后.我使用的是Rails 2.3.5和memcached 1.4.4(我也尝试过使用memcached 1.2.2).

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).

推荐答案

我相信在Rails应用仍在运行时重新启动memcached时会发生此错误.如果您在重新启动memcached之后重新启动mongrel或乘客中的rails应用程序,则不会出现此问题.

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.

这篇关于使用Memcached的Rails中的管道错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆