Skip to content

Add retry on EINTR. #527

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add retry on EINTR. #527

wants to merge 5 commits into from

Conversation

mit-da
Copy link

@mit-da mit-da commented Jun 14, 2023

Try and fix issue #242 by adding a retry on EINTR and a sleep before attempting to do so. This is based off of #291.
We happen to come across a few instances of EINTR in our usage every day and would like to add a single retry since it seems all further LDAP calls are successful. Only kept it to a single retry for now, though I could be convinced to raise it.

mit-da added 5 commits June 14, 2023 15:32
Try and fix issue python-ldap#242 by adding a retry on EINTR and a sleep before attempting to do so.
similar to original function to pass tests.
@mit-da
Copy link
Author

mit-da commented Jul 13, 2023

Apologies for the delay, pretty inexperienced with python. Made some changes to fix tests.

@spaceone
Copy link
Contributor

doesn't it already work when you use ldap.ldapobject.ReconnectLDAPObject instead of ldap.ldapobject.SimpleLDAPObject?

@mit-da
Copy link
Author

mit-da commented Jul 19, 2023

I tested with ldap.ldapobject.ReconnectLDAPObject and unfortunately the interrupts still occur and don't seem to retry. The bind action seems to work but a call to say modify a group will throw the error.

@mistotebe
Copy link
Contributor

Is setting the LDAP_OPT_RESTART option not working? Can you post the backtrace when this happens?

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