there are issues that need to be fixed related to the shutdown refactor.
- a
stop method should be implemented that force-closes the socket to make sure it will not ne stuck in IO somewhere regardless if we are using select... for safety.
- I would change the current close method to
def close
@udp.close rescue nil
end
and add an identical stop method
def stop
@udp.close rescue nil
end
note that with a proper stop the current close method is useless, unless we move the UDPSocket creation in the register method as proposed in #10 where we could have a situation where the plugin register method is called but not the run & stop and then only close, like in specs in which case both close and stop are required.
- there is an error in the
spec_helper.rb at
plugin.stop should be rewritten as
plugin.do_stop
input_thread.join
otherwise the stop? method will never return true and there could be race conditions with the input thread.
there are issues that need to be fixed related to the shutdown refactor.
stopmethod should be implemented that force-closes the socket to make sure it will not ne stuck in IO somewhere regardless if we are using select... for safety.and add an identical stop method
note that with a proper
stopthe currentclosemethod is useless, unless we move the UDPSocket creation in the register method as proposed in #10 where we could have a situation where the pluginregistermethod is called but not therun&stopand then onlyclose, like in specs in which case bothcloseandstopare required.spec_helper.rbatlogstash-input-udp/spec/spec_helper.rb
Line 17 in 1205076
plugin.stopshould be rewritten asotherwise the
stop?method will never returntrueand there could be race conditions with the input thread.