Any syntactically bad log statement will fail every other log message forever
Closed this issue · 2 comments
I plan to submit a patch to address this tomorrow, but I wanted to report my findings today.
Short version of the story: the log buffer (batchP
) is only cleared upon a successful Write
to InfluxDB. This means that if a single bad statement is written, then the buffer will continue to fill and never be cleared, causing every log statement to attempt to send an ever-increasing buffer of logs to InfluxDB.
This can happen for silly, simple reasons:
- Someone logged
WithField
X of typefloat
and you try to logWithField
X of typeinteger
. That will always fail until the InfluxDB database is cleared. - You accidentally log a
uint64
value, and the InfluxDB client supports encoding this asXXXu
but the InfluxDB server does not (as of version 1.5.3) support parsing this value.
In both of these cases, the application that is logging will gradually slow down and die.
My proposed fix is to have writePoints
always clear the buffer (batchP
) and update lastBatchUpdate
, and then just return an error if there happened to be one when writing.
👍
I submitted #24 to address this.