Skip to content
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

Assert crash when tailing double logrotated file #231

Open
TheHinsh opened this issue Dec 1, 2021 · 0 comments
Open

Assert crash when tailing double logrotated file #231

TheHinsh opened this issue Dec 1, 2021 · 0 comments

Comments

@TheHinsh
Copy link

TheHinsh commented Dec 1, 2021

When a log file being monitored by the aws-kinesis-agent is (inadvertently) log rotated twice, the following code in TrackedFileRotationAnalyzer.java will assert, causing the agent to stop working (and likely not recover properly due to ungracefully closing down).

        Preconditions.checkState(incoming.size() > 1); // always true after rotation by Truncate
        Preconditions.checkState(hasCounterpart(incoming.get(0))); // always true for rotation by Truncate

Commenting (or just removing) these two lines will allow the code to properly close down the tailing of a file that has been double log rotated.

        // Preconditions.checkState(incoming.size() > 1); // always true after rotation by Truncate
        // Preconditions.checkState(hasCounterpart(incoming.get(0))); // always true for rotation by Truncate
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

No branches or pull requests

1 participant