JDK-8139965 : Hang seen when using com.sun.jndi.ldap.search.replyQueueSize
  • Type: Bug
  • Component: core-libs
  • Sub-Component: javax.naming
  • Affected Version: 7u85,8,11
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2015-10-20
  • Updated: 2020-05-29
  • Resolved: 2019-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 8 Other
11.0.5-oracleFixed 13Fixed 8u221Fixed openjdk8u232Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Submitter has been trying to receive a huge (several millions) resultset from their LDAP server but have failed with an out of memory on the heap. The preferred solution is to use the Paged result but our LDAP server is not yet supporting that feature. As a workaround solution we found this setting in the openJDK: com.sun.jndi.ldap.search.replyQueueSize 

This setting is to my understanding pausing the LDAP server read thread when the resultset list has reached 80% of the configured value. 

Our problem now is that when having this variable configured all processing will stop when we reached the 80% mark. It seems that the thread never continue to receive entries when the queue size in back below the mark.
Comments
For 8u: Please include a fix request when adding jdk8u-fix-request. RFR is https://mail.openjdk.java.net/pipermail/jdk8u-dev/2019-August/010177.html
03-09-2019

Fix Request: Requesting this patch for OpenJDK11 updates. It is part of Oracle 11.0.5. Review started: https://mail.openjdk.java.net/pipermail/jdk-updates-dev/2019-June/001257.html Patch will be run through SAP's test system.
03-06-2019

Attaching original patch proposed.
22-08-2018

An RFR was started on this a long time back[1]. Submitter stopped replying so I was unable to vouch that root cause was solved. In any case, Paged Results should be used to solve such issues. [1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-August/042762.html
22-08-2018

main threads of interest : See with this property being set : properties.put("com.sun.jndi.ldap.search.replyQueueSize", "15"); "Thread-0" daemon prio=6 tid=0x000000000ac4e000 nid=0x207c in Object.wait() [0x000000000d06f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000007d7f00440> (a java.lang.Object) at java.lang.Object.wait(Object.java:503) at com.sun.jndi.ldap.Connection.pauseReader(Connection.java:813) at com.sun.jndi.ldap.Connection.run(Connection.java:953) - locked <0x00000007d7f00440> (a java.lang.Object) at java.lang.Thread.run(Thread.java:745) "main" prio=6 tid=0x000000000029e000 nid=0x25e8 in Object.wait() [0x000000000292e000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x00000007d7f005f0> (a com.sun.jndi.ldap.LdapRequest) at java.lang.Object.wait(Object.java:503) at com.sun.jndi.ldap.Connection.readReply(Connection.java:471) - locked <0x00000007d7f005f0> (a com.sun.jndi.ldap.LdapRequest) at com.sun.jndi.ldap.LdapClient.getSearchReply(LdapClient.java:639) at com.sun.jndi.ldap.LdapClient.getSearchReply(LdapClient.java:607) at com.sun.jndi.ldap.LdapCtx.getSearchReply(LdapCtx.java:1919) at com.sun.jndi.ldap.LdapNamingEnumeration.getNextBatch(LdapNamingEnumeration.java:129) at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreImpl(LdapNamingEnumeration.java:216) at com.sun.jndi.ldap.LdapNamingEnumeration.hasMore(LdapNamingEnumeration.java:189) at com.sun.jndi.ldap.LdapNamingEnumeration.hasMoreElements(LdapNamingEnumeration.java:116) at MassiveSearchTests.main(MassiveSearchTests.java:54)
05-08-2016

Awaiting a thread dump of hanging threads. Marking incomplete.
20-10-2015