Skip to content

Fix: avoid refering a SincedbValue when it's not present in SincedbCollection #273

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

Conversation

andsel
Copy link
Contributor

@andsel andsel commented May 13, 2020

If the value of the setting sincedb_clean_after is too short (1 ms) it happens that during the content reading loop (in read mode) the loops itself trigger the cleanup of the same value from the SincedbCollection and then it
also try to access it again creating an error.
This commit resolves the problem guarding against the presence in the sincebd_collection before accessing it.

Fixes: #272

@andsel andsel requested a review from jsvd May 14, 2020 07:12
Copy link
Member

@jsvd jsvd left a comment

Choose a reason for hiding this comment

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

LGTM please bump a patch version.
Also please rename the commit header message to something like Fix: skip sincedb eviction if read mode completion deletes file during flush?

…g flush

If the value of the setting `sincedb_clean_after` is too short (1 ms) it happens that during the content reading loop (in read mode) the loops itself trigger the cleanup of the same value from the SincedbCollection and then it
also try to access it again creating an error.
This commit resolves the problem guarding against the presence in the sincebd_collection before accessing it.

Fixes: logstash-plugins#272
Closes: logstash-plugins#273
@andsel andsel force-pushed the fix/bug_during_startup_with_sincedb_Clean_after_too_small branch from f68075d to be18de7 Compare May 14, 2020 12:11
@elasticsearch-bot elasticsearch-bot merged commit be18de7 into logstash-plugins:master May 14, 2020
@elasticsearch-bot
Copy link

Andrea Selva merged this to master!

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.

Read mode cleanup causes crash when sincedb_cleanup_after is low (under a second)
3 participants