The finally Block Always Executes
By Sharon Zakhour on Aug 28, 2008
Russel pointed out that, though it might be obvious, the
finally block will not be executed if the JVM exits while in the process of executing the
catch code. Likewise (and this is where it might be less obvious), if the code is executing on another thread and that thread is interrupted or killed, the
finally block would not be executed, even if the application continues.
This exact problem led to a production outage that Russel helped to debug.
I have modified this page of the tutorial to include a note about this fact. Thanks, Russel, for helping us to improve the tutorial!
-- Sharon Zakhour