Repository navigation
agent exits when drained so the launcher can wait for a clean upload - #22
Merged
Merged
Conversation
LogTailer assumed logrotate-style rotation (.1 = newest) with a live active file at the session root, but the client writes monotonic incrementing windows (<channel>.<index>.log[.gz], 1 = oldest) with the active file hidden in <sessionId>/.tmp/. Live-tailing a session large enough to rotate past one window dropped every window after the first (~50% kernel loss on large sessions; on-disk data was intact, only the live upload was truncated). Rewrite tail() to the window model: send each complete window whole in ascending index order and finish once the session's .tmp/ dir is gone (the client removes it after every channel closes) plus a short straggler grace. In stream mode a published .gz window is already the exact gzipped-NDJSON wire format, so upload it verbatim as one chunk (publishStreamGz) instead of decompressing and re-batching into <=1MB POSTs: the agent no longer holds a whole decompressed window and a large session uploads in a handful of chunks. The cursor advances immediately after the durable 2xx so a crash cannot re-send the whole window. Drop the dead RandomAccessFile-based readLineUtf8 left from the old tailer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The agent is a daemon that blocks forever, so
gpufl trace --uploadrelied onthe launcher hard-killing it after a fixed delay - which truncated the live
upload whenever the drain took longer than that delay.