RubyMine:终止超时工作线程

标签 ruby docker remote-debugging rubymine puma

我在 docker 中调试应用程序时遇到问题。我认为我的设置是正确的,因为没有调试器一切都工作正常。

端口

command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
    volumes:
      - .:/usr/src/app
    ports:
      - "3000:3000"
      - "1234:1234"
      - "26162:26162"
      - "26168:26168"

错误:(网站没有响应)

Fast Debugger (ruby-debug-ide 0.7.0, debase 0.2.4.1, file filtering is supported) listens on 0.0.0.0:1234
=> Booting Puma
=> Rails 5.2.3 application starting in development 
=> Run `rails server -h` for more startup options
[8] Puma starting in cluster mode...
[8] * Version 4.0.1 (ruby 2.6.2-p47), codename: 4 Fast 4 Furious
[8] * Min threads: 5, max threads: 5
[8] * Environment: development
[8] * Process workers: 2
[8] * Preloading application
[8] * Listening on tcp://0.0.0.0:3000
[8] Use Ctrl-C to stop
[8] ! Terminating timed out worker: 16
[8] ! Terminating timed out worker: 18
[8] ! Terminating timed out worker: 20
[8] ! Terminating timed out worker: 21
[8] ! Terminating timed out worker: 24
[8] ! Terminating timed out worker: 25
[8] ! Terminating timed out worker: 28
[8] ! Terminating timed out worker: 29

enter image description here enter image description here

最佳答案

我刚刚想通了。

我的解决方案将WEB_CONCURRENCY设置为0(config/puma.rb)

workers ENV.fetch("WEB_CONCURRENCY") { 0 }

对于生产系统,我更改了 .env 文件中的值。

WEB_CONCURRENCY=2

来源: * https://github.com/JetBrains/sample_rails_app/blob/master/config/puma.rb

# Note that workers are not supported for JRuby or Windows
#workers ENV.fetch("WEB_CONCURRENCY") { 2 }

关于RubyMine:终止超时工作线程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59054977/

相关文章:

php - Codeigniter mysql无法在docker中连接

c++ - 使用 RSE 进行远程 C++ 调试

python - Pycharm在docker compose中调试manage.py命令

ruby-on-rails - 子文件夹中的子类模型不会自动加载

sql-server - Docker 容器无法连接到远程服务器上的 SQL Server

ruby - ruby 哈希的通用重组(深度为 4)

docker - Docker Compose 与 Dockerfile 有什么区别

shell - gdbserver:执行目标的shell命令

ruby - 使用 RubyMine 在类之间移动方法

ruby - 将 gem 中的 ruby​​ 脚本添加到路径