Skip to content
Permalink
Browse files

CONJ-623 / Increase connection logging when Primary node connection f…

…ails

(cherry picked from commit d4fcfbe)
  • Loading branch information...
fgaule authored and rusher committed Jul 2, 2018
1 parent b4c4c4d commit 9f91ca424c9e460dd9d1223d211d4ee40045c7ca
@@ -183,10 +183,12 @@ public HandleErrorResult handleFailover(SQLException qe, Method method, Object[]
throw new SQLException("Connection has been closed !");
}
if (setMasterHostFail()) {
logger.warn("SQL Primary node [{}, conn={}] connection fail. Reason : {}",
this.currentProtocol.getHostAddress().toString(),
this.currentProtocol.getServerThreadId(),
qe.getMessage());
logger.warn("SQL Primary node [{}, conn={}, local_port={}, timeout={}] connection fail. Reason : {}",
this.currentProtocol.getHostAddress().toString(),
this.currentProtocol.getServerThreadId(),
this.currentProtocol.getSocket().getLocalPort(),
this.currentProtocol.getTimeout(),
qe.getMessage());
addToBlacklist(currentProtocol.getHostAddress());
}

@@ -1326,6 +1326,11 @@ public long getServerThreadId() {
return serverThreadId;
}

@Override
public Socket getSocket() {
return socket;
}

public boolean isExplicitClosed() {
return explicitClosed;
}
@@ -68,6 +68,7 @@

import java.io.IOException;
import java.io.InputStream;
import java.net.Socket;
import java.net.SocketException;
import java.nio.charset.Charset;
import java.sql.SQLException;
@@ -199,6 +200,8 @@ boolean executeBatchServer(boolean mustExecuteOnMaster, ServerPrepareResult serv

long getServerThreadId();

Socket getSocket();

void setTransactionIsolation(int level) throws SQLException;

int getTransactionIsolationLevel();

0 comments on commit 9f91ca4

Please sign in to comment.
You can’t perform that action at this time.