[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: ldap_search blocks after several hundred consequtive searches without ldap_result being called (ITS#2389)



> -----Original Message-----
> From: Rand [mailto:rand@sendmail.com]

> On Thu, 20 Mar 2003, Howard Chu wrote:

> > First of all, I suggest you change your client to avoid this request
pattern.
> > We'll look into insuring the server doesn't lock up.
>
> Yup, done that.  I figured this wouldn't be easy to fix.
>
> One question though, is it possible to query the state of the LDAP context
> to determine if submitting a new search will block, or some kind of flags
> I could pass to ldap_search or ldap_search_ext to indicate that the
> function should not submit the search and return an error if it would
> block.

In OpenLDAP 2.1's client library you will get an LDAP_BUSY error from a
request that would block. Specifically, if you try to submit a new request
while a current request is still pending (not fully transmitted), you will
get the LDAP_BUSY result. I suggest you upgrade.

> More importantly, if we are requesting a very large data set in an search
> (either many entries or entries with very large attributes), and the
> search_result is bigger than the local network buffers, will ldap_result
> possibly block waiting for all the data to come through from
> the server?

That depends on the arguments you supplied to ldap_result. If you pass a
non-zero argument for the "all" parameter then it will not return until it
has read the entire result, however large it may be. Otherwise, it will
return when one message has been received. In the case of a search that
returns many entries, each entry is received in its own message. In the case
of a search returning a single large entry, you'll be blocked until the
entire entry is received.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support