Skip to content

Conversation

@borislaviv
Copy link
Contributor

Currently the pool is initiated so that servers are retried indefinetely. This makes it hard to define concrete hard timeout for login operation.

This change exposes ldap3's ServerPool active parameter as setting. That way it provides means to resolve situations as with #264.

Based on the following docs: https://ldap3.readthedocs.io/en/latest/server.html#server-pool

Currently the pool is initiated so that servers are retried
indefinetely. This makes it hard to define concrete hard timeout for
login operation.

This change exposes ldap3's ServerPool active parameter as setting. That
way it provides means to resolve situations as with etianen#264.

https://ldap3.readthedocs.io/en/latest/server.html#server-pool
@etianen
Copy link
Owner

etianen commented Jun 15, 2024

Thanks for this!

Do you think it might be best to make the new default 1, rather than True?

@etianen etianen merged commit 33dbd62 into etianen:master Jun 15, 2024
@etianen
Copy link
Owner

etianen commented Jun 15, 2024

Released as 0.15.7 ❤️

@borislaviv
Copy link
Contributor Author

Thanks for this!

Do you think it might be best to make the new default 1, rather than True?

I intend to put 2 * len(settings.LDAP_AUTH_URL) to account for random strategy attempts. I didn't want to change the default though as it will change existing behavior. It was introduced with this change and I'm not sure if this wasn't an intentional decision.

Maybe @hho6643 can chime in?

Note that the same is valid for the rest of pool arguments. I can extend this patch to make them configurable as well if you think this is of any value.

@hho6643
Copy link
Contributor

hho6643 commented Jun 17, 2024

Hi - it wasn’t an intentional decision. Having a timeout is an improvement IMHO. And it looks like it’s already merged so 👍

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.

3 participants