Closed morian closed 2 years ago
I also noticed during the debugging that _ready()
is called continuously due to the fact that we listen to the socket POLLOUT
events through the writer:
https://github.com/noirello/bonsai/blob/034ec671b60e41f1181a64ea4a7fe3d1dff7967a/src/bonsai/asyncio/aioconnection.py#L38
I am not sure whether this is needed here, but can confirm that it is called appropriately when these writers are removed. This has little to do with the original issue here but still can be worth enough to be mentioned.
Thank you. I think that was an oversight from my part. This method should return True
instead of None
, when no new password is returned, just like the add
and delete
methods.
I did a commit based on version 1.3.0 for future references: https://github.com/morian/bonsai/commit/74efefa69e05cae72f5aa6acedb20f156393759f
It seems like the tests do not check for the return value.
Great. Can I create PR from your patch?
Sure, go ahead if you think it fully covers the issue!
Hi!
I am now trying to use
modify_password
in async mode, which works fine when no new password is provided. Unfortunately, this raises a strange error in async mode:When a new password is provided, the server is expected to return no data, which is handled here: https://github.com/noirello/bonsai/blob/034ec671b60e41f1181a64ea4a7fe3d1dff7967a/src/_bonsai/ldapconnection.c#L1080
In this situation,
None
is returned as the result to the python caller.In async mode, a result
None
means that the caller has to try again later as described here: https://github.com/noirello/bonsai/blob/034ec671b60e41f1181a64ea4a7fe3d1dff7967a/src/bonsai/asyncio/aioconnection.py#L41This can be fixed by returning
True
or any other value instead ofNone
, but that would break the user API and existing applications. On the other hand, rewriting the way these loops work may be a lot of work :-(.Regards,
Romain