splunk_handler
splunk_handler copied to clipboard
fix multiple process queue not sharing
when use handler in uwsgi --master
the Queue and comsumer worker will be created by master
process, but the producer is child process.
when use handler in celery worker, also have the problem above.
Hey @lovemyliwu thanks for submitting this! Can you give me a little more information or background on the use-case for this change? Also is it possible to write a test to ensure we don't break multi-process queue functionality in the future?
@zach-taylor If you use this splunk-handler inside a process that in turn spawns celery workers the celery workers will not be able to push logs to splunk (things like file handlers etc seem to work fine). This pr will allow all logs, both the root process & the celery workers, to be pushed to splunk.
Is there any chance this can get merged in? I would really appreciate it.
@zach-taylor a bit of background when you run this in production where you are running this behind uwsgi you won't see all of the messages. It's not clear why this is happening but we can correlate the N+1 threads are not capturing logs.
@rh0dium or @lovemyliwu if this is still something that is desired, can one of you take on getting the PR updated with latest master and addressing any codeclimate issues? This does appear to be backwards compatible, and the PR conversations suggest general interest.