Question about proper usage and multiple queries…?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Question about proper usage and multiple queries…?

Matthew M. DeLoera
Hello,

I hope this list is still getting read. Haven't noticed any posts coming into my inbox in a while!

Anyway, debugging strange crashes with mozldap 6.0.6 in Win7 64-bit. Still debugging, but wanted to throw out this question to know if I'm actually using the library as intended…

Once I'm bound, my usage resembles:

ldap_search_ext(…) -> returns 0 and msg ID 301
ldap_result(msg ID 301) -> returns 0
ldap_result(msg ID 301) -> returns 100
ldap_result(msg ID 301) -> returns 0
ldap_search_ext(…) -> returns 0 and msg ID 311
ldap_result(msg ID 311) -> returns 0
ldap_search_ext(…) -> returns 0 and msg ID 312
ldap_result(msg ID 312) -> returns 0
ldap_search_ext(…) -> returns 0 and msg ID 327
ldap_result(msg ID 327) -> returns 0
ldap_result(msg ID 301) -> returns 0
ldap_result(msg ID 311] -> returns 0
ldap_result(msg ID 312] -> returns 0
ldap_result(msg ID 327] -> returns 0
ldap_result(msg ID 301] -> returns 0
ldap_result(msg ID 311] -> returns 100
ldap_result(msg ID 312] -> returns 100
ldap_result(msg ID 327] -> returns 100
ldap_result(msg ID 301] -> returns 0

Basically 4 searches at the same time, being checked in a loop. I do this about once per every 5 minute boundary. Everything runs fine for hours, and then finally:

ldap_result(msg ID 311] -> returns -1

Still looking to see if I'm accidentally calling abandon or unbind - not sure yet. But otherwise, isn't it really odd that message ID 311 returned -1 from ldap_result, after just returning 0 or 100? The LDAP error is "Bad parameter to an ldap routine" and "unknown message id".

Anyway, my code then calls ldap_abandon_ext with message ID 311, which returns 0.

But then a subsequent call to ldap_result with message ID 312 crashes down in the memcache.

Anyway, is this reasonable usage? Or am I really only supposed to have 1 active message ID at a time?

And I should mention that all 4 of my queries have identical filter strings. Kind of stupid I know, but was simpler for my coding. I think I'll patch to only execute a unique query once. But could there be memcache collision because of matching filter strings or matching returned DNs, even though the message IDs are different? I studied the memcache code, and the key algorithm seems like it's using message ID to keep from colliding.

And if ldap_result ever returns -1, should I just drop that message ID and not even try to call ldap_abandon_ext?

In any case, things do run for hours without any noticeable issues. Any suggestions or insights would be *really* appreciated. Thanks!

Regards,
- Matthew
_______________________________________________
dev-tech-ldap mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-ldap