Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk15u-dev Public archive

Commit 028242b

Browse files
author
Yuri Nesterenko
committed
8258753: StartTlsResponse.close() hangs due to synchronization issues
Backport-of: 415553325831b79a7e55071f6bd7c73eb1a636ec
1 parent e00b466 commit 028242b

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,17 +1786,23 @@ private void waitForClose() throws IOException {
17861786
SSLLogger.fine("wait for close_notify or alert");
17871787
}
17881788

1789-
while (!conContext.isInboundClosed()) {
1790-
try {
1791-
Plaintext plainText = decode(null);
1792-
// discard and continue
1793-
if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
1794-
SSLLogger.finest(
1795-
"discard plaintext while waiting for close", plainText);
1789+
appInput.readLock.lock();
1790+
try {
1791+
while (!conContext.isInboundClosed()) {
1792+
try {
1793+
Plaintext plainText = decode(null);
1794+
// discard and continue
1795+
if (SSLLogger.isOn && SSLLogger.isOn("ssl")) {
1796+
SSLLogger.finest(
1797+
"discard plaintext while waiting for close",
1798+
plainText);
1799+
}
1800+
} catch (Exception e) { // including RuntimeException
1801+
handleException(e);
17961802
}
1797-
} catch (Exception e) { // including RuntimeException
1798-
handleException(e);
17991803
}
1804+
} finally {
1805+
appInput.readLock.unlock();
18001806
}
18011807
}
18021808
}

0 commit comments

Comments
 (0)