Skip to content
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

Possible fix to #8563 - unset $ldapUsers to avoid OOM'ing #8594

Merged
merged 1 commit into from
Oct 23, 2020

Conversation

uberbrady
Copy link
Collaborator

There was also a typo which I fixed - checkLdapConnetion instead of checkLdapConnection

We deliberately unset $ldapUsers because it's going to be a chunk of 500 or so LDAP users, (and some paging information). We recursively call processLdapUsers() over and over to page through the entire directory, but $ldapUsers won't get Garbage-Collected until the entire recursive function series completes.

So I temporarily store the current page from the result set, then I deliberately unset() the $ldapUsers variable before the recursive call is made.

I can't replicate the bug locally, unfortunately, so I can't be certain that this will help, but this seems like it at least won't hurt.

@uberbrady uberbrady requested a review from snipe October 23, 2020 04:57
Copy link
Owner

@snipe snipe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@uberbrady uberbrady merged commit d517e2f into snipe:develop Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants