使用 memcached 时发生 Rails 中的断管错误

发布于 2024-08-26 23:44:45 字数 480 浏览 4 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

治碍 2024-09-02 23:44:45

我相信当您在 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文