Description
Sometime daemons can get killed by YARN's pmem monitor which issue a kill followed by kill -9 after 250ms. This is really a short duration to collect anything useful.
There is no clean way to trap SIGKILL in java.
One option is to increase the time between kill and kill -9 in YARN and during that time we can have a shutdown hook handler to collect all diagnostics information like heapdump, jstack, jmx output etc. in a non-container directory.