Thanks Wei-Chiu Chuang and Daniel Templeton for bringing this to my attention.
I am fine with putting out a warning in the case of an exception or throwable during shutdown. I want to emphasize that whatever resolution is decided upon for this JIRA, the functionality of allowing the shutdown thread to finish without hanging should be maintained.
Wei-Chiu Chuang stated in this comment of HDFS-7533, "It looks to me that catching Throwable and ignore it may cause other issues, for example, ignoring a OOME can be pretty bad."
Meanwhile, Kihwal Lee pointed out in this comment of HDFS-7533 that "We can check whether a responder is running, but it may be in the process of shutting down. Therefore, a proper check requires additional locking."
In my opinion, putting in the logic to do additional locking and handling of exceptions is more complicated than is warranted during the datanode shutdown thread. The locking could also cause additional risk and complexity. I do agree that ignoring an OOM may cause a total datanode crash. However, that would be more desirable in this case than a datanode hang, which was happening before
HDFS-7533. Will ignoring other throwables also cause the datanode to hang?