本文介绍了提前终止工人彪马日志的含义是什么,为什么会发生这种情况?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的Elastic Beanstalk实例,每次访问它都会得到一个 504 状态码响应.当我拖尾日志时,我在puma应用服务器上看到以下日志:

For my Elastic Beanstalk instance, I am getting a 504 status code response whenever I visit it. When I tail the logs I see the following log on the puma app server:

==> /var/log/puma/puma.log <==
[27240] Early termination of worker
[27245] Early termination of worker
[27249] Early termination of worker
[27253] Early termination of worker
[27257] Early termination of worker
[27261] Early termination of worker
[27265] Early termination of worker
[27269] Early termination of worker
[27273] Early termination of worker
[27277] Early termination of worker

工人的提前解雇是什么意思,为什么会这样?此外,日志是否可以指示我在远程环境中面临的超时错误的原因?Rails应用程序和puma在我的本地计算机(Mac OS Catalina 10.15)上完美运行.但是,在如上所述的远程Elastic Beanstalk环境中,我收到超时504错误,并且在日志中看到的唯一内容是上述puma日志.

What does Early termination of worker mean and why is it happening? Moreover, could the log be indicating the cause of my timeout error I am facing in my remote environment? The rails app and puma run perfectly on my local machine (Mac OS Catalina 10.15). However, in my remote Elastic beanstalk environment as stated above I am getting a timeout 504 error and the only thing I see in the logs is the above puma log.

这是我的gemfile:

This is my gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.1'
# Use mysql as the database for Active Record
gem 'mysql2', '>= 0.4.4'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use haml view syntax
gem 'haml-rails'

# the main komponent gem is broken for Rails 6, see:
# https://github.com/komposable/komponent/issues/133
gem 'komponent', github: '0x2C6/komponent'
gem 'elasticsearch', '~> 6.2'
gem 'redis'

# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
  gem 'pry-rails'
  gem 'rspec-rails', '~> 3.9'
  gem 'dotenv-rails'
  gem 'awesome_print'
end

group :beta, :production do
  gem 'puma_worker_killer'
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'web-console', '>= 3.3.0'
  gem 'listen', '>= 3.0.5', '< 3.2'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'spring-watcher-listen', '~> 2.0.0'
  gem 'spring-commands-rspec'
   # Avoid polling for changes (Windows)
  gem 'wdm', '>= 0.1.0', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
end

group :test do
  gem 'webmock'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

推荐答案

好,因此这需要进行大量的调试,并且会遇到很多麻烦.这个问题非常简单.我创建了一个拼写错误并称为 GetLitsingsResponse 的类.将类更改回 GetListingsResponse 后,Puma在我的远程AWS Elastic beantalk环境中可以正常工作.在我的Mac OS Puma上本地非常奇怪,这没有问题.但是在运行Ruby 2.6(Puma)平台的64位Amazon Linux 2018.03 v2.11.4中,Puma无法正常运行.

Ok so this took a lot of debugging and going down a lot of different rabbit holes. The problem was very painfully simple. I created a class which I misspelled and called, GetLitsingsResponse. After changing the class back to GetListingsResponse Puma works just fine in my remote AWS Elastic beanstalk environment. It's very strange out locally on my Mac OS Puma had no problem. But in the 64bit Amazon Linux 2018.03 v2.11.4 running Ruby 2.6 (Puma) platform Puma would not function normally.

这篇关于提前终止工人彪马日志的含义是什么,为什么会发生这种情况?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 10:09