You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by nn...@apache.org on 2021/06/28 22:59:59 UTC
[geode] branch support/1.13 updated: GEODE-9380: Replace sleep()s
from Nio.SslEngine replace with yields
This is an automated email from the ASF dual-hosted git repository.
nnag pushed a commit to branch support/1.13
in repository https://gitbox.apache.org/repos/asf/geode.git
The following commit(s) were added to refs/heads/support/1.13 by this push:
new b23902a GEODE-9380: Replace sleep()s from Nio.SslEngine replace with yields
b23902a is described below
commit b23902aae94c4b86bc06ace919d4fae1026bcb71
Author: Kamilla Aslami <ka...@vmware.com>
AuthorDate: Tue Jun 15 15:11:52 2021 -0700
GEODE-9380: Replace sleep()s from Nio.SslEngine replace with yields
(cherry picked from commit 1b97c7c25f1fb68a94d5c7008b98630de45d48b6)
---
.../src/main/java/org/apache/geode/internal/net/NioSslEngine.java | 7 +++----
.../src/main/java/org/apache/geode/internal/net/SocketCreator.java | 5 -----
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java b/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java
index 4c603a0..1bae252 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/NioSslEngine.java
@@ -89,8 +89,7 @@ public class NioSslEngine implements NioFilter {
* state. It may throw other IOExceptions caused by I/O operations
*/
public boolean handshake(SocketChannel socketChannel, int timeout,
- ByteBuffer peerNetData)
- throws IOException, InterruptedException {
+ ByteBuffer peerNetData) throws IOException {
if (peerNetData.capacity() < engine.getSession().getPacketBufferSize()) {
throw new IllegalArgumentException(String.format("Provided buffer is too small to perform "
@@ -152,7 +151,7 @@ public class NioSslEngine implements NioFilter {
// if we're not finished, there's nothing to process and no data was read let's hang out
// for a little
if (peerAppData.remaining() == 0 && dataRead == 0 && status == NEED_UNWRAP) {
- Thread.sleep(10);
+ Thread.yield();
}
if (engineResult.getStatus() == BUFFER_OVERFLOW) {
@@ -203,7 +202,7 @@ public class NioSslEngine implements NioFilter {
logger.info("handshake terminated with illegal state due to {}", status);
throw new IllegalStateException("Unknown SSL Handshake state: " + status);
}
- Thread.sleep(10);
+ Thread.yield();
}
if (status != FINISHED) {
logger.info("handshake terminated with exception due to {}", status);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
index 0621d2d..258d545 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/net/SocketCreator.java
@@ -638,11 +638,6 @@ public class SocketCreator extends TcpSocketCreatorImpl {
}
logger.warn("SSL handshake exception", e);
throw e;
- } catch (InterruptedException e) {
- if (!socketChannel.socket().isClosed()) {
- socketChannel.close();
- }
- throw new IOException("SSL handshake interrupted");
} finally {
if (blocking) {
try {