JDK-8062947 : Fix exception message to correctly represent LDAP connection failure
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-11-05
  • Updated: 2022-06-27
  • Resolved: 2020-05-07
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13 JDK 15 JDK 8 Other
11.0.10Fixed 13.0.6Fixed 15 b23Fixed 8u261Fixed openjdk8u272Fixed
Related Reports
Relates :  
Relates :  
Description
The current LDAP connection code can't distinguish the difference between connection failure reasons, i.e. closure and the timeout. For connection closure case the NamingException with incorrect message is thrown:
"LDAP response read timed out, timeout used:-1ms."
Comments
Fix request (13u) I'd like to backport this patch to 13u as followup of JDK-8160768. Patch applies cleanly. This patch is also required for clean backport of JDK-8245527
16-11-2020

8u patch also reviewed by Andrew Hughes. https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-September/012654.html
08-09-2020

The posted patch - https://cr.openjdk.java.net/~zgu/JDK-8062947-8u/webrev.00/ - seems to contain multiple changes unrelated to this bug: $ diffstat -p0 8062947.11u b/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java | 65 +-- b/src/java.naming/share/classes/com/sun/jndi/ldap/LdapRequest.java | 27 + b/test/jdk/com/sun/jndi/ldap/NamingExceptionMessageTest.java | 164 ++++++++++ 3 files changed, 205 insertions(+), 51 deletions(-) $ diffstat -p0 8062947.8u b/src/share/classes/com/sun/jndi/ldap/Connection.java | 65 b/src/share/classes/com/sun/jndi/ldap/DefaultLdapDnsProvider.java | 4 b/src/share/classes/com/sun/jndi/ldap/LdapDnsProviderService.java | 25 b/src/share/classes/com/sun/jndi/ldap/LdapRequest.java | 27 b/test/com/sun/jndi/ldap/LdapTimeoutTest.java | 778 +++++----- b/test/com/sun/jndi/ldap/NamingExceptionMessageTest.java | 165 ++ b/test/com/sun/jndi/ldap/lib/BaseLdapServer.java | 27 7 files changed, 668 insertions(+), 423 deletions(-) Pushing back to review.
07-09-2020

Critical Fix Request (8u) I would like to backport this patch to 8u for parity with Oracle 8u271. The original patch does not apply cleanly. 8u patch has been reviewed by Paul Hohensee. This fix is critical to openjdk8u272, as it is a followup of JDK-8160768, an important 8u272 backport, we should not leave it broken.
02-09-2020

8u code review: https://mail.openjdk.java.net/pipermail/jdk8u-dev/2020-September/012616.html
02-09-2020

11u downport note I would like to downport this for parity with 11.0.9-oracle. Applies clean, but the test does not compile as it depends on JDK-8151678, which should be downported too. That again depends on two more changes to be downported. The previous changes were downported. Patch still applies clean, and tests fine. I would like to bring this to 11.0.9 as it is a follow up to the LDAP changes we downported to 11.0.9.
02-09-2020

URL: https://hg.openjdk.java.net/jdk/jdk/rev/868fe697bad4 User: aefimov Date: 2020-05-07 18:21:17 +0000
07-05-2020

By default the read timeout (com.sun.jndi.ldap.read.timeout) is not set and it is equivalent to waiting for the response infinitely until it is received: https://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-ldap.html#PROP
05-05-2020