resque-pool
resque-pool copied to clipboard
log writing failed. can't be called from trap context
After starting resque-pool via
bundle exec resque-pool --daemon --environment production
resque-pool.stdout.log is populated without issue, but resque-pool.stderr.log complains
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
log writing failed. can't be called from trap context
It's related to logging inside a signal handler--resque and resque-scheduler have migrated to mono_logger to work around this issue.
https://github.com/resque/resque/issues/1493 https://github.com/steveklabnik/mono_logger
Any help would be greatly appreciated, thanks!
We are encountering a similar issue.
I found this on the interwebs:
LOG_QUEUE = Queue.new
Thread.start do
logger = Logger.new(STDOUT)
nil while logger.info(LOG_QUEUE.pop)
end
Use it like so:
LOG_QUEUE << "my log to STDOUT, works in trap context too"
https://github.com/resque/resque/issues/1493#issuecomment-358711299