使用 memcached 时发生 Rails 中的断管错误
我在 Rails 应用程序上不断遇到此错误 MemCacheError (Broken pipeline): Broken pipeline,但我不明白为什么。
当我在控制器中通过 Rails.cache
访问 memcached 时,前 1 或 2 次读/写似乎总是抛出损坏的管道错误。但是,当我通过创建新对象 ActiveSupport::Cache::MemCacheStore.new
来访问 memcached 时,我似乎没有收到此错误。
我还在另一个 ruby 进程中访问 memcached,无论我如何访问 memcached,第一次读取总是出现此错误。我确实通过重试读取来实现解决方案,但我宁愿有一个更好的长期解决方案。
目前,我唯一一次看到此问题是在重新启动 memcached 后。我正在使用 Rails 2.3.5 和 memcached 1.4.4(我也尝试过使用 memcached 1.2.2)。
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).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我相信当您在 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.