Skip to content

Resume logs on failure and restart #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 30, 2025
Merged

Conversation

hogklint
Copy link
Owner

No description provided.

@hogklint hogklint self-assigned this Mar 30, 2025
The two previous methods of determining where to restart a log stream do
not work well enough. Using the container start time sometimes skip
the first logs, using the latest stop time sometimes include logs from
previous run that were already printed.

So this new method keeps track of which logs are already printed and
skips them. It stores the printed log's timestamp and the number of logs
printed on that timestamp.

This introduces a new order dependency though. If a container delete
event is handled before the log stream of said container terminates it
will add an entry to the `seenContainers` cache even though the
container does not exist. Haven't seen that happen though and the only
downside is it might evict containers from that cache that still exist.
Had to move the log request to Start in order to inject the log stream
to consumeStream.
@hogklint hogklint force-pushed the feat/retry-failed-tails branch from ac3911e to 75c2235 Compare March 30, 2025 15:31
@hogklint hogklint merged commit 84bf0ae into master Mar 30, 2025
1 check passed
@hogklint hogklint deleted the feat/retry-failed-tails branch March 30, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant