https://bugs.openldap.org/show_bug.cgi?id=10229
Issue ID: 10229 Summary: ldap_result, when invoked with MSG_RECEIVED and a timeout value set to 0 (polling), does not return all available messages until it is called again Product: OpenLDAP Version: 2.6.8 Hardware: All OS: All Status: UNCONFIRMED Keywords: needs_review Severity: normal Priority: --- Component: libraries Assignee: bugs@openldap.org Reporter: nivanova@symas.com Target Milestone: ---
The issue is noticeable when ldap_result is used by the proxy back-ends. It has not affected back-meta behavior, because when a first call is unsuccessful, it retries with a small timeout. back-asyncmeta will also usually call it twice on the same connection from different threads, although this is not a desired behavior.
https://bugs.openldap.org/show_bug.cgi?id=10229
--- Comment #1 from Ondřej Kuzník ondra@mistotebe.net --- Does ITS#10060 (not in 2.6 though) relate to this in any way?
https://bugs.openldap.org/show_bug.cgi?id=10229
--- Comment #2 from Nadezhda Ivanova nivanova@symas.com --- (In reply to Ondřej Kuzník from comment #1)
Does ITS#10060 (not in 2.6 though) relate to this in any way?
Doesn't seem so at the moment, it is in the same code, but this problem occurs when all=2 (MSG_RECEIVED) with a tv={0} (polling). Any other combination of these and things work as expected.
https://bugs.openldap.org/show_bug.cgi?id=10229
--- Comment #3 from Ondřej Kuzník ondra@mistotebe.net --- Could you describe the issue in more detail? i.e. what does it mean "unsuccessful" in your description, does it mean it will return an error? What error?
https://bugs.openldap.org/show_bug.cgi?id=10229
--- Comment #4 from Nadezhda Ivanova nivanova@symas.com --- Even though there is still at least one message in ld_responses, it sets errno to -5 (timeout), instead of returning this message in the *result pointer, as should be the case when called with MSG_RECEIVED.
https://bugs.openldap.org/show_bug.cgi?id=10229
Quanah Gibson-Mount quanah@openldap.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|needs_review | Target Milestone|--- |2.6.9
https://bugs.openldap.org/show_bug.cgi?id=10229
Ondřej Kuzník ondra@mistotebe.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |IN_PROGRESS Ever confirmed|0 |1
--- Comment #5 from Ondřej Kuzník ondra@mistotebe.net --- A patch is available at https://git.openldap.org/openldap/openldap/-/merge_requests/722
It keeps the current behaviour of MSG_RECEIVED that if there are matching messages in ld_responses, the stored messages are returned and there is no attempt to read from a socket in that case. The caller was going to call it again anyway.