RFR [14] 8217606: LdapContext#reconnect always opens a new connection

Pavel Rappo pavel.rappo at oracle.com
Wed Aug 7 12:47:40 UTC 2019


Please review the following change:


The original issue seems to be an unintended consequence of JDK-8059009 [1].
The proposed change is based on the private patch by Chris Yin. I skimmed
through the history of the `com.sun.jndi.ldap.Connection.useable` flag which
dates back to JDK-4532408 [2]

    - Maintains a flag, 'useable', to indicate whether underlying network
    connection is useable. A connection starts out useable and becomes
    unuseable when an IO error is encountered while reading from/writing
    to it.

and I believe that this field is a good fit for what Chris has proposed.

Not only does the proposed change fix the issue, it also introduces a reusable
test component for mocking/stubbing/faking an LDAP server. Chris and myself took
some time in our private correspondence to shape that component such that it
would allow to refactor some of the existing LDAP tests, should we decide to 
do so.

As far as mach5 is concerned, the change looks good.


[1] https://bugs.openjdk.java.net/browse/JDK-8059009
[2] https://bugs.openjdk.java.net/browse/JDK-4532408

More information about the core-libs-dev mailing list