From 68ecdc07535ea9b22014bcfd38a7c7372c432903 Mon Sep 17 00:00:00 2001 From: Adam Potolsky Date: Wed, 20 May 2015 16:54:42 -0700 Subject: [PATCH] Added additional logging to help debug potential problems related to performance and SSL WAIT states #4650 --- src/lib/plugin/ns/SecureSocket.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/plugin/ns/SecureSocket.cpp b/src/lib/plugin/ns/SecureSocket.cpp index 7d7c9a83..f182ee8a 100644 --- a/src/lib/plugin/ns/SecureSocket.cpp +++ b/src/lib/plugin/ns/SecureSocket.cpp @@ -379,7 +379,16 @@ SecureSocket::checkResult(int n, bool& fatal, int& retry) case SSL_ERROR_WANT_CONNECT: case SSL_ERROR_WANT_ACCEPT: retry += 1; - LOG((CLOG_DEBUG2 "need to retry the same SSL function retry:%d", retry)); + // If there are a lot of retrys, it's worth warning about + if ( retry % 5 == 0 ) { + LOG((CLOG_INFO "need to retry the same SSL function(%d) retry:%d", errorCode, retry)); + } + else if ( retry == (maxRetry() / 2) ) { + LOG((CLOG_WARN "need to retry the same SSL function(%d) retry:%d", errorCode, retry)); + } + else { + LOG((CLOG_DEBUG2 "need to retry the same SSL function(%d) retry:%d", errorCode, retry)); + } break; case SSL_ERROR_SYSCALL: