Needs review
Project:
Lightweight Directory Access Protocol
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Feb 2023 at 20:41 UTC
Updated:
27 Feb 2025 at 00:56 UTC
Jump to comment: Most recent
Comments
Comment #2
aaronbaumanAppears to be related to #3192905: More graceful handling in GroupUserUpdateProcessor on invalid configuration where a duplicate email address is confusing ldap module and causing a fatal error during cron, killing the whole process.
Comment #3
aaronbaumanThere is a "timeout" of 10 seconds set up on the LDAP query, but the query appears to run for 60+ seconds and doesn't time out.
Comment #4
kylemac commentedI'm running into this issue as well, have about 10,000 users. Running on the latest dev branch that fixes the issue of stopping when email exists, but it will just randomly stop with no logged message every time, after only 5-20 minutes or so. Anyone have any ideas? Thanks
Comment #5
bluegeek9 commentedWhich 'periodic update' feature are you using?
There is an orphan processor to handle accounts provisioned from LDAP but are no longer in LDAP. "Periodic orphaned accounts update mechanism". This has a limit of the number of users to check, along with a
There is also an update that requires an LDAP query. "Periodic user update mechanism". This one has an interval. What is your interval?
You can also run the cron with drush and not have a timeout.
Comment #6
aaronbaumanThis is the periodic update feature I'm referring to from
ldap_user_cron():Specifically,
$processor->runQuery($ldapUpdateQuery);issues an LDAP query which may not return within various lower-level time limits (between 59 - 120 seconds on Pantheon, for example), which means my users don't get updated.If I lower the time limit for the query, and the query fails to complete in time, then my users still don't get updated.
Is there a way to paginate the LDAP queries, or maybe update the mechanism to look for recent changes only, or another way you can think of that would reduce the footprint here?
Comment #7
bluegeek9 commentedThe
Query.php does have pagination features. It is not as simple as providing an offset. It appears it serializes the query object.
Comment #8
bluegeek9 commentedIt looks like pagination is implemented like this:
Comment #9
aaronbaumanOK, we don't need to use pagination, we can take advantage of Drupal queue.
Instead of iterating the entire LDAP query result set in \Drupal\ldap_user\Processor\GroupUserUpdateProcessor::runQuery, this method should create a queue entry for each item.
Then the queue process can do the iteration without blocking cron, and will easily pick up wherever it leaves off when the batch takes too long.
Should actually be relatively straightforward to untangle these.
Comment #11
aaronbaumanI'll have to keep an eye on how it performs, but i *think* this will solve the issue for me. (MR105)
Rather than the initial LDAP user query, it's the subsequent processing that was taking the most time.
The system queue processor has a timer to prevent overrunning cron, so this should be a nice and tidy solution.