logstash-plugins / logstash-input-snmp

Apache License 2.0
17 stars 22 forks source link

invoke close on Snmp and/or Transport object upon plugin termination #81

Closed colinsurprenant closed 4 years ago

colinsurprenant commented 4 years ago

Followup of #80 Currently the snmp input does not implement the stop method to release snmp4j resources by calling the Snmp#close method. After the #80 refactor this is tricky because we are now using singleton objects for either udp or tcp transports and close should only be called if no plugin is using the singleton object.

The potential problem is that if there are no more snmp inputs defined after some pipeline reloading for example, the snmp listener might still be active and associated resources not freed.

I am not sure if we should look into another strategy than the singleton pattern or add some reference counting to correctly call close.

colinsurprenant commented 4 years ago

fixed by #84