final long stop = System.currentTimeMillis()
+ HANDSHAKE_TIMEOUT_MILLIS;
synchronized (sessionManager) {
while (true) {
final UpdateMessage um = sessionManager.get(request);
final Type type = um.type();
checkCancelled(type);
if (PROCEED_REDEPLOYMENT_RESPONSE.equals(type))
break;
final long remaining = stop - System.currentTimeMillis();
if (0 >= remaining)