-deleteOnExit when JVM shutsdown non gracefully
Asaf Mesika 2013-04-10, 09:30
In the CoprocessorHost.java file, there's the following code section used
to load a coprocessor jar:
File tmpLocal = new File(dst.toString());
There's an assumption here that the JVM will gracefully shutdown (as
opposed to machine went dead, kill -9, OutOfMemory which cause kill -9 in
plain vanilla HBase).
If this happens, the temp jar and CRC files will remain there.
We saw in a production environment a case where there were 300k files there
(only jar and crc files releated to our coprocessor jar filename).
It seems right to me, to add code section which deletes the stale files
upon startup of the region server (just deletes all *.jar before a certain
timestamp). Or better - place them in /tmp/hbase, and delete the contents
of this folder upon startup.
What do you think?