Fix AIR live log polling correctness - #6694
Conversation
Integration test reportCommit: 838f580
Top 3 slowest tests (at least 2 minutes):
|
| } | ||
| } | ||
| if remember && st.lastNano != 0 { | ||
| st.fromSec = max(st.streamStartSec, st.lastNano/1_000_000_000-int64(bricklensLogLookback/time.Second)) |
There was a problem hiding this comment.
Initial tail may leak omitted history:
After printing the newest N records, the code moves fromSec back by 30 seconds but remembers only those N records. The next poll fetches the overlap and prints older, omitted records as if they were new.
Example: an active run has lines 1, 2, 3; --tail 2 can print 2, 3, then 1 on the next poll.
This defeats both the line limit and chronological ordering. The Python implementation has the same bug, so the Go port matches it but is not independently correct.
(not from this PR but may be relevant) Go’s --tail 0 diverges from Python: Go accepts it and later prints the backlog, while Python rejects zero.
caroline-db
left a comment
There was a problem hiding this comment.
implementation looks good but some tests still need to be updated to reflect the new help text and to fail for --tail 0.
Summary
--minutesbehaviorThis matches the AIR Python CLI behavior in databricks-eng/universe#2611686.
Validation
./task lint-q-count=1-count=1GOFLAGS=-buildvcs=false ./task build