Override ShutdownStrategy in Syslogd, Trapd Camel contexts
Description
We are not overriding the ShutdownStrategy in the syslog and trap contexts which means that they will use the default 300 second (5 minute) timeout when in-flight messages are still present in the Camel queues.
This causes problems if syslog and trap messages are received shortly after startup (which is likely) because Karaf is refreshing the Camel contexts. If a refresh happens, the context must be shutdown and restarted and the shutdown can experience the 5 minute timeout. This makes Minion startup take minutes and may cause Karaf feature install timeouts.
We need to override the default ShutdownStrategy with a strategy that uses reduced timeout values.
Verified that trapd listener shutdown happens in 15 secs instead of 300 secs
Seth Leger October 1, 2016 at 10:09 AM
Edited
It is easy to reproduce this problem by just restarting the minion service a couple of times, eventually it will get caught trying to fetch the SNMPv3 config. I think you can also reproduce by:
Start up minion + opennms
Shutdown opennms
Send a few syslog or trap messages to the minion system
Immediately shut minion down
It should still be retrying to send the syslogs/traps to opennms (which is down) and this will cause the shutdown to take 5 minutes for each context that has the default timeout.
We are not overriding the ShutdownStrategy in the syslog and trap contexts which means that they will use the default 300 second (5 minute) timeout when in-flight messages are still present in the Camel queues.
This causes problems if syslog and trap messages are received shortly after startup (which is likely) because Karaf is refreshing the Camel contexts. If a refresh happens, the context must be shutdown and restarted and the shutdown can experience the 5 minute timeout. This makes Minion startup take minutes and may cause Karaf feature install timeouts.
We need to override the default ShutdownStrategy with a strategy that uses reduced timeout values.