Skip to content

Commit

Permalink
IGNITE-20759 Fix writing post-handshake message in NIO server (#11036)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandasch authored Nov 17, 2023
1 parent 461977b commit d026266
Show file tree
Hide file tree
Showing 6 changed files with 224 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,8 @@ private void processWriteSsl(SelectionKey key) throws IOException {
try {
boolean writeFinished = writeSslSystem(ses, sockCh);

if (!handshakeFinished) {
// If post-handshake message is not written fully (possible on JDK 17), we should retry.
if (!handshakeFinished || !writeFinished) {
if (writeFinished)
stopPollingForWrite(key, ses);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public BlockingSslHandler(SSLEngine sslEngine,
SocketChannel ch,
boolean directBuf,
ByteOrder order,
IgniteLogger log)
throws SSLException {
IgniteLogger log
) {
this.ch = ch;
this.log = log;
this.sslEngine = sslEngine;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1186,12 +1186,6 @@ private long safeTcpHandshake(
try {
return tcpHandshakeExecutor.tcpHandshake(ch, rmtNodeId, sslMeta, msg);
}
catch (IOException e) {
if (log.isDebugEnabled())
log.debug("Failed to read from channel: " + e);

throw new IgniteCheckedException("Failed to read from channel.", e);
}
finally {
if (!timeoutObject.cancel())
throw handshakeTimeoutException();
Expand Down
Loading

0 comments on commit d026266

Please sign in to comment.