After getting the rmApp, you should replace:
RMAppAttempt appAttempt = rmApp.getAppAttempts().get(appAttemptId);
RMAppAttempt appAttempt = rmApp.getAppAttempt(appAttemptdId);
The current getAppAttempts() returns an unmodifiable collection of a non-threadsafe map which isn't useful at all. The latter uses proper synchronization to lookup the attempt.
You may also be saddened to learn that a synchronized copy of the blacklist hashset is created just to get the size. Bonus points for fixing that, but not necessary.