Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
8258753: StartTlsResponse.close() hangs due to synchronization issues
Backport-of: 415553325831b79a7e55071f6bd7c73eb1a636ec
  • Loading branch information
Yuri Nesterenko committed Jul 30, 2021
1 parent e00b466 commit 028242b
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
Expand Up @@ -1786,17 +1786,23 @@ private void waitForClose() throws IOException {
SSLLogger.fine("wait for close_notify or alert");
}

while (!conContext.isInboundClosed()) {
try {
Plaintext plainText = decode(null);
// discard and continue
if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
SSLLogger.finest(
"discard plaintext while waiting for close", plainText);
appInput.readLock.lock();
try {
while (!conContext.isInboundClosed()) {
try {
Plaintext plainText = decode(null);
// discard and continue
if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
SSLLogger.finest(
"discard plaintext while waiting for close",
plainText);
}
} catch (Exception e) { // including RuntimeException
handleException(e);
}
} catch (Exception e) { // including RuntimeException
handleException(e);
}
} finally {
appInput.readLock.unlock();
}
}
}

1 comment on commit 028242b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.