Skip to content

Commit

Permalink
More improvements to debug logging inspired by Chrome+NIO2 investigat…
Browse files Browse the repository at this point in the history
…ions

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1710179 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Oct 23, 2015
1 parent 743461a commit f65c25a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
16 changes: 13 additions & 3 deletions java/org/apache/coyote/http2/Http2UpgradeHandler.java
Expand Up @@ -220,16 +220,26 @@ public void init(WebConnection webConnection) {
socketWrapper.write(true, settings, 0, settings.length);
socketWrapper.flush(true);
} catch (IOException ioe) {
throw new ProtocolException(sm.getString("upgradeHandler.sendPrefaceFail"), ioe);
String msg = sm.getString("upgradeHandler.sendPrefaceFail", connectionId);
if (log.isDebugEnabled()) {
log.debug(msg);
}
throw new ProtocolException(msg, ioe);
}

// Make sure the client has sent a valid connection preface before we
// send the response to the original request over HTTP/2.
try {
parser.readConnectionPreface();
} catch (Http2Exception e) {
throw new ProtocolException(
sm.getString("upgradeHandler.invalidPreface", connectionId));
String msg = sm.getString("upgradeHandler.invalidPreface", connectionId);
if (log.isDebugEnabled()) {
log.debug(msg);
}
throw new ProtocolException(msg);
}
if (log.isDebugEnabled()) {
log.debug(sm.getString("upgradeHandler.prefaceReceived", connectionId));
}

// Send a ping to get an idea of round trip time as early as possible
Expand Down
3 changes: 2 additions & 1 deletion java/org/apache/coyote/http2/LocalStrings.properties
Expand Up @@ -100,13 +100,14 @@ upgradeHandler.invalidPreface=Connection [{0}], Invalid connection preface
upgradeHandler.ioerror=Connection [{0}]
upgradeHandler.noNewStreams=Connection [{0}], Stream [{1}], Stream ignored as no new streams are permitted on this connection
upgradeHandler.pause.entry=Connection [{0}] Pausing
upgradeHandler.prefaceReceived=Connection [{0}], Connection preface received from client
upgradeHandler.pingFailed=Connection [{0}] Failed to send ping to client
upgradeHandler.pruneIncomplete=Connection [{0}] Failed to fully prune the connection because streams were active / used in the priority tree. There are [{0}] too many streams
upgradeHandler.pruneStart=Connection [{0}] Starting pruning of old streams. Limit is [{1}] + 10% and there are currently [{2}] streams.
upgradeHandler.pruned=Connection [{0}] Pruned completed stream [{1}]
upgradeHandler.prunedPriority=Connection [{0}] Pruned unused stream [{1}] that may have been part of the priority tree
upgradeHandler.rst.debug=Connection [{0}], Stream [{1}], Error [{2}], RST (closing stream)
upgradeHandler.sendPrefaceFail=Failed to send preface to client
upgradeHandler.sendPrefaceFail=Connection [{0}], Failed to send preface to client
upgradeHandler.socketCloseFailed=Error closing socket
upgradeHandler.stream.closed=Stream [{0}] has been closed for some time
upgradeHandler.stream.even=A new remote stream ID of [{0}] was requested but all remote streams must use odd identifiers
Expand Down

0 comments on commit f65c25a

Please sign in to comment.