You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use the conn.delete() to remove an entry from the directory and accidentally passed in wrong parameters, this did lead to an endless retry in the call to conn.delete().
Here is a code snippet out of a test case which I am using to run against my openldap server:
server=Server(
host=self.host,
port=self.port,
get_info="ALL",
connect_timeout=1,
)
conn=Connection(server, client_strategy="RETRYING", raise_exceptions=True)
users_container_dn= "cn=users,dc=organization,dc=intranet`
withconn:
# Idea is to delete an entry if it exists, and otherwise ignore the exception if it does not existtry:
# This line had the typo in the format stringconn.delete(f"uid=test-user",{users_container_dn})
# Correct would have been the following line:# conn.delete(f"uid=test-user,{users_container_dn}")print("deleted")
exceptException:
print("exception")
In the code above if the user entry does exist in the directory, then I don't see "deleted" and I also don't see "exception" being printed out. Instead it seems to be retrying in the conn.delete call.
Only after creating the ticket I've noticed the typo in my code. Even though the mistake was on the user side, this seems to be accidentally hiding this exception in the retrying loop.
The text was updated successfully, but these errors were encountered:
johbo
changed the title
Using delete with RETRYING strategy can lead to endless loop
Passing incorrect parameters to delete with RETRYING strategy can lead to endless loop
Dec 12, 2024
I've noticed a tiny typo after creating this issue, going to update the description. Not sure if this is something to improve or even a case that could be closed as "won't fix".
I've tried to use the
conn.delete()
to remove an entry from the directory and accidentally passed in wrong parameters, this did lead to an endless retry in the call toconn.delete()
.Here is a code snippet out of a test case which I am using to run against my openldap server:
In the code above if the user entry does exist in the directory, then I don't see "deleted" and I also don't see "exception" being printed out. Instead it seems to be retrying in the
conn.delete
call.Only after creating the ticket I've noticed the typo in my code. Even though the mistake was on the user side, this seems to be accidentally hiding this exception in the retrying loop.
The text was updated successfully, but these errors were encountered: