ruby-on-rails - Rails 调试器在一段时间后自动退出,Ubuntu 终端选项卡挂起

标签 ruby-on-rails debugging byebug

我正在使用 byebug 调试我的 Rails 应用程序。调试器停止但在一段时间后自动继续并给出:

[5188] !终止超时 worker :5378

  • Worker 0 (pid: 5959) 已启动,阶段:0

有时它也会使终端挂起。 请帮忙!

最佳答案

我可以通过更改 config/puma.rb 中的 worker_timeout 来解决这个问题。 似乎问题已经在使用这些行的新 Rails 6.1 项目中得到解决:

# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
#
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"

默认为 90 秒。

puma 文档说:

Verifies that all workers have checked in to the master process within the given timeout. If not the worker process will be restarted. This is not a request timeout, it is to protect against a hung or dead process. Setting this value will not protect against slow requests.

https://www.rubydoc.info/gems/puma/Puma%2FDSL:worker_timeout

关于ruby-on-rails - Rails 调试器在一段时间后自动退出,Ubuntu 终端选项卡挂起,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51292576/

相关文章:

ruby-on-rails - 多部分电子邮件的 Markdown 为文本/纯文本和文本/html

ruby-on-rails - Rails 4 找不到关联 has_many,通过 : relationship error

java - 在 Cassandra 中调试 CQL 输入时无法查看用户输入

javascript - 如何在 Javascript 中重写函数提升?

qt4 - Qt4书说“发布”,现实不同意

ruby-on-rails - 在本地/测试中开发时如何保持电子邮件公司的 IP 信任

ruby-on-rails - 如何在带有Elasticsearch-rails的映射中设置路由

ruby - pry 的 whereami 的 byebug 版本是什么?

ruby - Byebug 是否完全支持 Windows?

ruby-on-rails - 运行 byebug 8.2.1 Mac M1 时出错