Open klausman opened 2 years ago
Gentle ping :) Any help?
After some experimentation, we have a found a workaround:
buffer-size=8192
Specific size of course likely depends on environment, and possibly on the size of the JSON generated.
It's of course still a bug, but at least we now know of a mitigation.
Our own bug for tracking this is here: https://phabricator.wikimedia.org/T312550
(aka 2.0.18-1 in Debian)
We have the following logging config for a uwsgi application:
To summarize, we have:
/srv/log/ores/main.log
, in classic one-line format127.0.0.1
port11514
(UDP), formatted as JSONThe second one goes to rsyslogd listening on port 11541, which then does some transformations and then sends the data to Kafka. This setup has worked for a long time, until we recently-ish updated to Debian Buster.
When we updated to Buster, the second logger broke quietly: the Kafka topics are empty. Local debugging shows that uwsgi is still sending datagrams to the relevant port, but they are all empty (
Len=0
):The way rsyslog is set up, it will not act on any of this, and thus, no messages are sent to Kafka.
While debugging this, I added an additional logger, using the same basic directives as the JSON/Logstash one, but logging to a local file. These are the added directives:
This will result in the correct data being logged to the file configured
The weird part: As soon as the third logger is added, the base JSON logger (to UDP) starts working. Datagrams as seen in Wireshark are no longer size 0, and the Logstash UI shows the topic receiving messages. Remove the third logger, and (after the remaining uwsgi process terminate), the messages are Len=0 again and nothing gets sent to Kafka.
I think this is a bug in uwsgi where JSON is not generated correctly unless it is written locally.