Input failures call `do_close` instead of `do_stop`
- Dominant language
- Java
- Stars
- 14.9k
- Forks
- 3.5k
- Avg merge
- 19h 14m
- Merged PRs (30d)
- 63
Description
If you look at https://github.com/elastic/logstash/blob/31693ddd22b16fc7e9956656da8d0d3e1ae7d768/logstash-core/lib/logstash/pipeline.rb#L450 you'll see that we rescue errors in input threads and call `do_close` when we should call `do_stop`.
Also, if you look at https://github.com/elastic/logstash/blob/31693ddd22b16fc7e9956656da8d0d3e1ae7d768/logstash-core/lib/logstash/pipeline.rb#L412 you'll notice that we use the same `register_plugins` function for inputs, filters, and outputs. This function calls `do_close` on error when it should call `do_stop`.
My recommendation is that we provide a default implementation of `do_close` in `Inputs::Base` that just calls `do_stop`. In Logstash 6.0+ we should only support `do_close`. Having two different names for inputs vs. filters/outputs is just confusing and will be a future source of bugs.
Contributor guide
Assessment
This issue has not been assessed yet.