Skip to content

Commit 8ada285

Browse files
author
Sheng Yang
committed
Suppress connection error messages
Load balancers would trigger this error message again and again.. Put them in to debug/trace level, instread of showing a calltrace.
1 parent 72cbd65 commit 8ada285

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

utils/src/com/cloud/utils/nio/Link.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,14 +369,18 @@ public static SSLContext initSSLContext(boolean isClient) throws Exception {
369369

370370
sslContext = SSLContext.getInstance("TLS");
371371
sslContext.init(kmf.getKeyManagers(), tms, null);
372-
s_logger.info("SSL: SSLcontext has been initialized");
372+
if (s_logger.isTraceEnabled()) {
373+
s_logger.trace("SSL: SSLcontext has been initialized");
374+
}
373375

374376
return sslContext;
375377
}
376378

377379
public static void doHandshake(SocketChannel ch, SSLEngine sslEngine,
378380
boolean isClient) throws IOException {
379-
s_logger.info("SSL: begin Handshake, isClient: " + isClient);
381+
if (s_logger.isTraceEnabled()) {
382+
s_logger.trace("SSL: begin Handshake, isClient: " + isClient);
383+
}
380384

381385
SSLEngineResult engResult;
382386
SSLSession sslSession = sslEngine.getSession();

utils/src/com/cloud/utils/nio/NioConnection.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,15 @@ protected void accept(SelectionKey key) throws IOException {
197197
sslEngine.setNeedClientAuth(false);
198198

199199
Link.doHandshake(socketChannel, sslEngine, false);
200-
s_logger.info("SSL: Handshake done");
201200
} catch (Exception e) {
202-
throw new IOException("SSL: Fail to init SSL! " + e);
201+
logDebug(e, key, 0);
202+
terminate(key);
203+
return;
203204
}
204205

206+
if (s_logger.isTraceEnabled()) {
207+
s_logger.trace("SSL: Handshake done");
208+
}
205209
socketChannel.configureBlocking(false);
206210
InetSocketAddress saddr = (InetSocketAddress)socket.getRemoteSocketAddress();
207211
Link link = new Link(saddr, this);

0 commit comments

Comments
 (0)