Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Race condition in input event handling leads to NullPointerException #5106
It should be possible to create an input and update it right after the creation. (e.g. when triggered from code)
When a user creates an input and updates it right after the creation, the input doesn't start and throws a
Input creation and update triggers events which are handled by the InputEventListener.
The problem is this case is, that the input gets restarted while it is still starting up.
I noticed the issue when using a GELF UDP input which uses the UDPTransport class.
The UDPTransport.launch() method is using the
In UDPTransport.stop() the
So while the input is still running the code in
I added some custom log statements to the code to illustrate the issue.
We have to make sure to serialize the event handlers for the same input so they cannot run in parallel.
I think we can either add locks to the
Steps to Reproduce (for bugs)
I noticed the issue while installing a content pack that contains an input with extractors and/or static fields. The content pack installation code first creates an input and then updates it to add extractors and static fields right after that. This seems to be so fast that the race condition gets triggered.
Another problem is, that our input persistence layer doesn't offer an API to atomically create an input with extractors, converters and static fields. (it might be possible by adding the additional fields to a