I did see and respond to your original message, but the response only went
to the mailing list, and I guess you wouldn’t have seen it if you weren’t
subscribed to the list or looking at the archive. This time, I’m responding
to both the list and to you specifically, so I apologize if you get it
twice, but hopefully you’ll get it at least once. Here’s the response that
I sent:
-----BEGIN ORIGINAL RESPONSE-----
Thanks for reporting this problem. This is a very strange issue because the
NullPointerException shows that the server is encountering a null variable
(the suppressNextResponse AtomicBoolean member in the
LDAPListenerClientConnection class) that is final and initialized to a
non-null value in the LDAPListenerClientConnection constructor.
However, I think that what’s going on is that the
LDAPListenerClientConnection constructor is creating a new request handler
instance before it’s initializing that suppressNextResponse variable, and
it’s providing an instance of the partially-initialized client connection
instance to that request handler. In this case, that request handler
happens to be an instance of your ProxyListenerRequestHandler, but I don’t
think that anything in your code is responsible for the exception.
I just committed a change that I think will fix this. It ensures that
suppressNextResponse (and one other variable) are initialized before
creating the request handler instance. You can test it by checking out and
building the LDAP SDK from either the SourceForge or GitHub repository
(just check out the code and run build.sh or build.bat, then take the
unboundid-ldapsdk.jar file from the resulting
build/package/unboundid-ldapsdk-4.0.2 directory). If this works, then you
can just run with that version that you built for yourself until the next
release of the LDAP SDK, which should hopefully happen around the end of
the month.
-----END ORIGINAL RESPONSE-----
Neil
On Tue, Oct 10, 2017 at 12:30 PM, Bryan Larson <bla...@gm...> wrote:
> I apologize if this came through as a duplicate. I received a
> notification that my initial attempt was caught in a filter with a reason
> of: Post by non-member to a members-only list. I have since joined the
> mailing list.
>
> I've recently implemented an LDAP proxy cache using Unboundid to handle
> the requests. I accomplished this by extending the
> LDAPListenerRequestHandler class and forwarding to a ProxyRequestHandler
> for binds, etc. and overriding the search and other relevant operations to
> look in a cache (using the search filter as the cache key).
>
> The above appears to be working successfully. However, I've had
> difficulty when running the proxy under load. I will start to get flooded
> with this stack trace:
>
> java.lang.NullPointerException
>
> at com.unboundid.ldap.listener.LDAPListenerClientConnection.sen
> dMessage(LDAPListenerClientConnection.java:661)
>
> at com.unboundid.ldap.listener.LDAPListenerClientConnection.sen
> dSearchResultEntry(LDAPListenerClientConnection.java:728)
>
> at com.unboundid.ldap.listener.LDAPListenerClientConnection.sen
> dSearchResultEntry(LDAPListenerClientConnection.java:797)
>
> at ldap.proxy.cache.ProxyListenerRequestHandler.processSearchRe
> quest(ProxyListenerRequestHandler.java:122)
>
> at com.unboundid.ldap.listener.LDAPListenerClientConnection.run
> (LDAPListenerClientConnection.java:584)
>
> FYI - the ProxyListenerRequestHandler class is my own. There's nothing
> overly proprietary in there, so I would be willing to disclose my own
> source code if it helped track down an issue.
>
> It's worth noting that I'm currently using version 3.2.0 of the LDAP SDK.
> It's also worth noting that I am not tethered to that version. Open to
> upgrading if it's worthwhile.
>
> Anything stand out, or anywhere that I should look? I'm fearful that
> there are some non-threadsafe things going on here, but not sure at the
> moment.
>
> Thanks,
> Bryan
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> ldap-sdk-discuss mailing list
> lda...@li...
> https://lists.sourceforge.net/lists/listinfo/ldap-sdk-discuss
>
>
--
*CONFIDENTIALITY NOTICE: This email may contain confidential and privileged
material for the sole use of the intended recipient(s). Any review, use,
distribution or disclosure by others is strictly prohibited. If you have
received this communication in error, please notify the sender immediately
by e-mail and delete the message and any file attachments from your
computer. Thank you.*
|