-
Notifications
You must be signed in to change notification settings - Fork 307
move async finish_register to bottom of register to avoid race condition #1125
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wasn't able to reproduce the original issue on local host, but the code changes seems wise.
For reliable reproduceability:
|
@jsvd tested as you suggested and it was reproducible, confirming that the PR fixes it. |
@logstashmachine bump patch |
This PR fixes a race condition between the thread running
register
and the one runningfinish_register
.The issue can be observed by having 20-30 simple pipelines in
pipelines.yml
like:Run Logstash w/ pipeline reloading:
Changing the pipeline config a few times and letting Logstash reload will eventually show one or more pipelines overwriting the index with "ecs-logstash":
Putting
finish_register
at the end of register ensures there are no concurrent instructions manipulating@index
and other internal state variables.fixes #1126