On Wed, 16 Aug 2023 23:11:11 GMT, Weibing Xiao <d...@openjdk.org> wrote:

>> Please refer to JDK-8314063.
>> 
>> The failure scenario is due to the setting of connection timeout. It is 
>> either too small or not an optimal value for the system. When the client 
>> tries to connect to the server with LDAPs protocol. It requires the 
>> handshake after the socket is created and connected, but it fails due to 
>> connection timeout and leaves the socket open. It is not closed properly due 
>> to the exception handling in the JDK code.
>> 
>> The change is adding a try/catch block and closing the socket in the catch 
>> block,  and the format of the code got changed consequently.
>
> Weibing Xiao has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   updated the code according to the review

src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java line 340:

> 338: 
> 339:     // create the socket without the factory
> 340:     private Socket createSocketWithoutFactory (String host, int port, 
> int connectTimeout) throws Exception {

i think the logic can be streamlined as per comment in main conversation

src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java line 381:

> 379:                     createInetSocketAddress(host, port);
> 380:             // unconnected socket
> 381:             socket = factory.createSocket();

i think the logic can be streamlined as per comment in main conversation

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/15294#discussion_r1296543226
PR Review Comment: https://git.openjdk.org/jdk/pull/15294#discussion_r1296543879

Reply via email to