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

handle EOF when checking archive validity #321

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

jsvd
Copy link
Member

@jsvd jsvd commented Oct 13, 2023

if the gzip file is truncated the EOF exception must be handled during archive validity check.

To test, create a truncated gzip file:

/tmp ❯ echo "1234567890" | gzip > a.gz
/tmp ❯ dd if=a.gz of=a.truncated.gz bs=1 count=5
5+0 records in
5+0 records out
5 bytes transferred in 0.000263 secs (19011 bytes/sec)

Then start Logstash:

bin/logstash -e "input { file { path => '/tmp/a.truncated.gz' sincedb_path => '/dev/null' mode => read check_archive_validity => true start_position => 'beginning' file_completed_action => log file_completed_log_path => '/tmp/log' } } "

closes #300

Copy link
Contributor

@andsel andsel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,
however it's not clear why Travis CI goes in timeout

@jsvd
Copy link
Member Author

jsvd commented Oct 17, 2023

@logstashmachine bump patch

@jsvd jsvd merged commit b2dd262 into logstash-plugins:main Oct 18, 2023
@jsvd jsvd deleted the handle_eof_gzip branch October 18, 2023 13:40
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.

Unexpected end of ZLIB input stream logstash 7.9.0
3 participants