<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif"><span style="font-family:Arial,Helvetica,sans-serif">On Thu, Aug 29, 2019 at 9:28 AM Guillaume Rousse <<a href="mailto:guillaume.rousse@renater.fr">guillaume.rousse@renater.fr</a>> wrote:</span><br></div></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">With Shibboleth IdP 3.4.4, the default LDAP connector configuration <br>
triggers regular warnings in our logs:<br>
org.ldaptive.pool.AbstractConnectionPool$DefaultPooledConnectionProxy@1fe12a85 <br>
failed validation<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">If you turn on DEBUG you should see the cause. Your assumption is likely correct, network disruption. The warn logs are indicators that you should tune your pool.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
The issue is probably coming either from our LDAP server, either from an <br>
intermediate network equipment shutting down connections considered as <br>
idle. Despite what ldaptive documentation says about periodic validation <br>
mechanism ("This functionality can also serve as a keep-alive for long <br>
lived connections"), this is obviously not working here, and we have to <br>
investigate.</blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">You need to tune the validation period. It's likely longer than whatever idle connection timeout your LDAP administrator has configured. Set your validation period shorter than that timeout.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
However, when pooling is considered desirable, I guess validation is <br>
needed to ensure pooled connections are actually usable. There isn't <br>
much detail about what is going to happen if the IdP tries to use a <br>
non-functional connection, but I guess it will just block until timeout <br>
occurs, and then fails.<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">If a broken connection is handed out by the pool, your connection will most likely wait until the responseTimeout occurs and then the connection will be reopened. So tune the responseTimeout parameter for your needs.</div></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So, I'd say than anyone wanting to use pooling should either:<br>
1) ensure its LDAP server will never close connections, whatever the <br>
activity of this connection<br>
2) ensure its LDAP server will never close *idle* connections, and <br>
consider connections with regular search operations as *active*<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">These are unreasonable requirements for any server. The LDAP connection handling should be robust enough to handle dropped connections. AFAIK that's the case, if you see otherwise please file a bug.</div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
3) configure expirationTime duration in accordance with the maximum <br>
connection duration on LDAP side<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">I'm not sure what you're getting at here, you'll need to elaborate.</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
4) enable periodic validation to regulary prune unusable connections, <br>
and face log flooding with invalidation messages<br></blockquote><div><br></div><div><div class="gmail_default" style="font-family:verdana,sans-serif">Pool validation messages are simply an indicator of the health of your pool. If your LDAP servers are reliable and you keep your connections alive, you'll likely never notice these messages. If your LDAP server undergoes lots of maintenance or your network is generally unreliable you will see these warnings in your logs. Regardless, these warn messages don't indicate a broken system, just one that needs tuning or can't be tuned.</div></div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div><div class="gmail_default" style="font-family:verdana,sans-serif">--Daniel Fisher</div><div class="gmail_default" style="font-family:verdana,sans-serif"><br></div></div></div>