Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,11 @@ protected Node curNode() {
return curNode;
}

void abortAndFail(TimeoutException timeoutException) {
this.aborted = true;
fail(time.milliseconds(), timeoutException);
}

/**
* Handle a failure.
*
Expand Down Expand Up @@ -818,8 +823,12 @@ private void failWithTimeout(long now, Throwable cause) {
log.debug("{} timed out at {} after {} attempt(s)", this, now, tries,
new Exception(prettyPrintException(cause)));
}
handleFailure(new TimeoutException(this + " timed out at " + now
+ " after " + tries + " attempt(s)", cause));
if (cause instanceof TimeoutException) {
handleFailure(cause);
} else {
handleFailure(new TimeoutException(this + " timed out at " + now
+ " after " + tries + " attempt(s)", cause));
}
}

/**
Expand Down Expand Up @@ -1130,7 +1139,7 @@ private void timeoutCallsInFlight(TimeoutProcessor processor) {
if (call.aborted) {
log.warn("Aborted call {} is still in callsInFlight.", call);
} else {
log.debug("Closing connection to {} to time out {}", nodeId, call);
log.debug("Closing connection to {} due to timeout while awaiting {}", nodeId, call);
call.aborted = true;
client.disconnect(nodeId);
numTimedOut++;
Expand Down Expand Up @@ -1375,7 +1384,7 @@ void enqueue(Call call, long now) {
client.wakeup(); // wake the thread if it is in poll()
} else {
log.debug("The AdminClient thread has exited. Timing out {}.", call);
call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread has exited."));
call.abortAndFail(new TimeoutException("The AdminClient thread has exited."));
}
}

Expand All @@ -1390,7 +1399,7 @@ void enqueue(Call call, long now) {
void call(Call call, long now) {
if (hardShutdownTimeMs.get() != INVALID_SHUTDOWN_TIME) {
log.debug("The AdminClient is not accepting new calls. Timing out {}.", call);
call.fail(Long.MAX_VALUE, new TimeoutException("The AdminClient thread is not accepting new calls."));
call.abortAndFail(new TimeoutException("The AdminClient thread is not accepting new calls."));
} else {
enqueue(call, now);
}
Expand Down