// Check whether it's a global session. We can ignore those
// because they are handled at the leader, but if not, rethrow.
// We check local session status first to avoid race condition
// with session upgrading.
if (!isGlobalSession(sessionId)) {
throw new SessionExpiredException();
}
}
}
}