简体   繁体   English

Rails 调试器在一段时间后自动退出,并且 Ubuntu 终端选项卡挂起

[英]Rails debugger exits automatically after some interval, and Ubuntu terminal tab hangs

I am using byebug for debugging my rails application.Debugger stops but continues automatically after some time interval and gives this:我正在使用 byebug 调试我的 rails application.Debugger 停止但在一段时间后自动继续并给出:

[5188] ! 【5188】! Terminating timed out worker: 5378终止超时工作者:5378

  • Worker 0 (pid: 5959) booted, phase: 0工人 0 (pid: 5959) 启动,阶段:0

and also when sometimes it makes terminal hang.有时也会使终端挂起。 Please help!请帮忙!

I could solve that problem by changing worker_timeout in config/puma.rb.我可以通过更改 config/puma.rb 中的 worker_timeout 来解决这个问题。 It seems that problem is already solved in new rails 6.1 projects using these lines:使用这些行的新 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"

Default is 90 seconds.默认值为 90 秒。

The puma documentation says:美洲狮文档说:

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_timeouthttps://www.rubydoc.info/gems/puma/Puma%2FDSL:worker_timeout

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM