lynxthecat / cake-autorate

Eliminate the excess latency and jitter terrorizing your 4G, 5G, LTE, Starlink or other variable rate connection!
https://www.bufferbloat.net
GNU General Public License v2.0
263 stars 24 forks source link

Gracefully deal with incomplete lines in the logfile #276

Closed moeller0 closed 4 months ago

moeller0 commented 4 months ago

On encountering an incomplete line, stop parsing, and work with the complete records parsed so far.

lynxthecat commented 4 months ago

@moeller0 how about skipping any bad line and then continuing on with any remaining lines?

rany2 commented 4 months ago

@lynxthecat your log should never be broken like this in the first place, I think it's appropriate for it to fail. Making this a warning will just mean that it will be ignored

moeller0 commented 4 months ago

So far the incomplete line was always the last in the file... so abortiung the parsing there seems fine. If the log contains incomplete lines higher up, I will need to revisit this.

lynxthecat commented 4 months ago

There could also be situations in which incomplete log lines are present not owing to any fault of cake-autorate, e.g. if users mess about with tail and merging files, etc.

moeller0 commented 4 months ago

I am more inclined to let users that break their log files like that keep both pieces...

It is one thing to not crash on a problematic logfile, but a whole different game trying to deduce what to trust in a non conforming logfile... As they say, trying to make things fool proof just creates selective pressure to evolve 'better' fools ;)