Thanks for taking a look, Nicolas.
Minor: Look like that pendingFile won't be null since the checkLease(..) method below will throw a LeaseExpiredException when file == null.
Not sure what you're referring to - the patch removes the checks against pendingFile == null. We now check only for fileBlocks == null. Are you suggesting I remove fileBlocks and the associated null check? That seems reasonable, since fileBlocks itself isn't used outside the null check.