mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 08:43:25 +08:00
23c38cbf11
This commit introduces the following changes: 1. Introduce the `SignalTrapLogger` singleton which starts a single thread that polls a queue to log messages with the specified logger. This thread is necessary becasue most loggers cannot be used inside the `Signal.trap` context as they rely on mutexes which are not allowed within the context. 2. Moves the monkey patch in `freedom_patches/unicorn_http_server_patch.rb` to `config/unicorn.config.rb` which is already monkey patching `Unicorn::HttpServer`. 3. `Unicorn::HttpServer` will now automatically send a `USR2` signal to a unicorn worker 2 seconds before the worker is timed out by the Unicorn master. 4. When a Unicorn worker receives a `USR2` signal, it will now log only the main thread's backtraces to `Rails.logger`. Previously, it was `put`ing the backtraces to `STDOUT` which most people wouldn't read. Logging it via `Rails.logger` will make the backtraces easily accessible via `/logs`. |
||
---|---|---|
.. | ||
environments | ||
initializers | ||
locales | ||
application.rb | ||
boot.rb | ||
cdn.yml.sample | ||
database.yml | ||
deploy.rb.sample | ||
dev_defaults.yml | ||
discourse_defaults.conf | ||
discourse.config.sample | ||
discourse.pill.sample | ||
environment.rb | ||
logrotate.conf | ||
multisite.yml.production-sample | ||
nginx.global.conf | ||
nginx.sample.conf | ||
projections.json | ||
puma.rb | ||
routes.rb | ||
sidekiq.yml | ||
site_settings.yml | ||
spring.rb | ||
thin.yml.sample | ||
unicorn_launcher | ||
unicorn_upstart.conf | ||
unicorn.conf.rb |