Open enjoy-binbin opened 3 years ago
I'll review it at depth when I have time, but I'm inclined not to accept this change.
Unless I'm missing something the error should lead to a reconnect and resending of the logs. Clearing the queue will cause the loss of perfectly good logs due to a simple reconnect issue, which would not be acceptable.
Yep Not problem. I understand it is risky
Or maybe we should just print some logs to help the user for debug
We can consider a tunable setting which would "discard logs on reconnect" and defaults to False
. Reconnects are a part of life and discarding logs isn't useful in most cases IMO.
I tend to make decisions against arbitrary loss of data.
Right. I can give a try. Thanks @arcivanov
@arcivanov I add a discard_logs_on_reconnect_error setting default false. Maybe not good enough
issue: https://github.com/fluent/fluent-logger-python/issues/175
When using asyncsender, there is a queue holds the logs to be send:
This is my solution, it doesn’t look particularly good. so feel free to close this if un-needed