Thanks for your reply.
I think HBase is a online DB. How long HBase failover takes is very important. Although kill -9 or network partition situation is a big event,the supervisor can judge that it's regionserver has crushed within ms,and hmaster can move regions which opened in the crushed regionserver to other alive regionservers.Therefore, the failover time is reduced to be accepted.
As stack and Lars said,shutdownhook is called when the regionserver process is alive and program logic isn't interrupted.The event which is kill -9 can't trigger event that shutdownhook would be called,so the the method deleteMyEphemeralNode would not be executed,in which case we'd need to rely on the ZK timeout.
My patch is order to reduce the failover time, which improves the availability of HBase.We have some big online hbase clusters which are all the core applications, and the acceptable failover time of the applications is about 10s~20s which include splitting hlog and recovering hlog lease and 'zk timeout'.