Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
Xing Lin committed Feb 2, 2024
1 parent 126523f commit 4c89beb
Showing 1 changed file with 4 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1089,29 +1089,19 @@ public void run() {
if (LOG.isDebugEnabled()) {
LOG.debug(getName() + ": starting, having connections " + connections.size());
}
} catch (Throwable t) {
// When we fail to start the rpcRequestThread, mark this connection as closed and call close().
// Then, we crash this thread/Connection. A new Connection will be re-created once we move this
// old one from the connetion pool in close().
String err =
String.format("Unexpected error in starting IPC.Connection.rpcRequestThread for connection %s", this);
markClosed(new IOException(err, t));
close();
throw t;
}

try {
while (waitForWork()) {//wait here for work - read or close connection
receiveRpcResponse();
}
} catch (Throwable t) {
// This truly is unexpected, since we catch IOException in receiveResponse
// -- this is only to be really sure that we don't leave a client hanging
// forever.
LOG.warn("Unexpected error reading responses on connection " + this, t);
markClosed(new IOException("Error reading responses", t));
String msg = String.format("Unexpected error on connection %s. Closing it.", this);
LOG.warn(msg, t);
markClosed(new IOException(msg, t));
}

close();

if (LOG.isDebugEnabled()) {
Expand Down

0 comments on commit 4c89beb

Please sign in to comment.