log-viewer
log-viewer copied to clipboard
bug when searching backwards for word
This error occurs when searching backwards for a given term. It's deterministic, it always happens when reaching the line starting with "2021-03-25 07:02:04.456 INFO 123695 ". The problem appears to be caused due to the overlapping time range of the new retrieved records with the current ones.
The assertion below is triggered.
// file: record-renderer.service.ts
if (end < m.length) {
SlUtils.assert(Record.compareTo(m[end - 1], m[end]) < 0);
}
Thank you for the bug report. I don't understand how is it possible. If you search bak from "2021-03-25 07:02:04.456", the backend must return records older than "2021-03-25 07:02:04.456", but it returns "2021-03-25 07:07:33.510". Could you attach or send me the log sample to reproduce? ([email protected])
Yeah, it looks like an off-by-one kind of problem. I've also changed the issue assignee to you, ok?
To reproduce the error, open the logfile, press Home, search for 'quartz', go forward a few times until you reach the given time spot, go forward one more time and backwards.
The attached log contains disordered records. There are the following records:
2021-03-25 07:02:04.402 DEBUG 123695 --- [freshExecutor-0] 2021-03-25 07:02:04.402 DEBUG 123695 --- [tbeatExecutor-0] 2021-03-25 07:02:33.510 DEBUG 123695 --- [tbeatExecutor-0] 2021-03-25 07:02:04.456 INFO 123695 --- [_MisfireHandler] 2021-03-25 07:02:33.510 DEBUG 123695 --- [ scheduling-1] 2021-03-25 07:02:33.510 DEBUG 123695 --- [-auto-1-exec-10]
Looks like the bold record must upper than 2021-03-25 07:02:33.510
, how does it possible?
Nice catch there. It may be due to the log level, just a guess. The record that is out of place is INFO.
Check this out: https://stackoverflow.com/questions/586824/why-are-my-log4j-log-file-timestamps-out-of-order-and-how-do-i-fix-it in fact, there are multiple threads writing to same log file.
It's sad... I have to make log-viewer tolerant to record disorder.
Yeah... I've actually seen that before, but I've never realized how common it is. I went through some of my log files in production and I saw several cases of that.
LogViewer 0.1.7 works correctly with logs containing disordered messages, but if you have one opened log only.