Skip to content
This repository has been archived by the owner on Sep 2, 2022. 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
Reviewed-by: coffeys
  • Loading branch information
Prajwal Kumaraswamy authored and coffeys committed Mar 30, 2021
1 parent 5375fda commit 484087b
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -1784,17 +1784,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 484087b

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