Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
8258753: StartTlsResponse.close() hangs due to synchronization issues
Reviewed-by: xuelei
  • Loading branch information
Prajwal Kumaraswamy authored and XueleiFan committed Mar 25, 2021
1 parent 3e18330 commit 4155533
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 @@ -1803,17 +1803,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 4155533

@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.