-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ldap_cron.php open lots of LDAP connections without closing it before the end #57
Comments
Hi, This problem is quite problematic for instances with large user base. Nobody have encountered this problem ? Thank you |
I have issues with the LDAP_Cron, it looks like its related to the number of connections. |
This sounds pretty nasty. Its been a while since I last looked at these extensions. I'm planning on spending my weekend restoring the project's automated build & testing so I can fix some issues. |
What we found out today is that we needed to increase the allowed open files on server level, because the connections were not closed. |
Oh dear, thats a horrible workaround. Brenard's suggestion around unsetting references to objects is most likely the solution so stuff can clean-up / GC. However I do remember this project having some nasty references being passed around so we didn't need to keep re-querying the LDAP server with multiple requests for every LDAP plug-in activated - so it might not be as easy as it sounds. |
Thank you Shaun to come back and take care with your excellent baby. I belong to the same team that Brenard, we are disturbed with this problem and it seems quite hard to make the right change. Your work on ldap with JMapMyLDAP is a reference in the Joomla community. We can help you as well as possible with tests and feedback. Kind regards, Hugues |
@ShMaunder : Do you found some time to take a look on it ? |
@ShMaunder I have changed the MaxConnections setting in Windows AD for LDAP but not sure if this was needed. |
Hello,
I'm using your great plugin to sync my LDAP users in Joomla. I have around 10 000 users in this LDAP directory and the
ldap_cron.php
is quit problematic in this context : for each users return by the first request listing all matching users in LDAP, it's open another connection (at least one) to LDAP directory without closing it before the end of the script. In my case, that means around 10 000 simultaneous connections to my LDAP directory.After studying this problem, I see several methods to fix this problem :
getInstance
method ofSHLdap
class could return an unique object reference for the same$id
and$authorised
?ldap_cron.php
, all LDAP connections have to be closed after processing each user. This seems to be what was originally intended : inldap_cron.php
, in users loop, anunset($adapter);
it's done before looping (but not in all exceptions cases) and theSHLdap
object have a__destruct()
method to handle LDAP connection closing. I'm not an expert of this special__destruct()
method, so I'm not sure this the good way to be sure to close the connection in all case but It is definitely the sexier one :) Regarding to PHP doc, "The destructor method will be called as soon as there are no other references to a particular object, or in any order during the shutdown sequence.". So, that mean we still have$adapter
reference after even afterunset
. FYI, If I commentSHLdapHelper::triggerEvent()
andSHUserHelper::save()
called and addunset
called on$options
and$instance
, LDAP connections are successfully closed.Thank you for any help !
The text was updated successfully, but these errors were encountered: