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

Re: send_search_entry aborts b/c ber_flush fails with errno=0 (ITS#1891)



>However, the code should never try to flush an empty buffer; every code
>path that drops into result.c:send_ldap_ber() (which invokes ber_flush)
should
>have filled the ber structure with data.

I agree completley, although this ended up not being the cause of our
problem.

>There are no references to EWOULDBLOCK in ber_flush, so I have ignored
that part
>of your suggested fixes.

I'm not sure what you are referring to here. To clarify, the problem we
were seeing with the openldap 2.0.14 currently used by Globus is that for
reasons we have not yet determined er_int_sb_write() was failing but with
errno=0. eg in syslog:

      slapd[18648]: ber_flush failed errno=0 reason="Success"
      slapd[18648]: send_ldap_response: ber write failed

The error check in ber_flush results in the errno=0 being considered a
fatal error. Effectively, the default behavior when ber_flush fails is to
the abort unless errno is either EWOULDBLOCK or EAGAIN. I still have to dig
deeper to find out why the lower level sb_write() is failing but returning
a zero error code, so perhaps our 'fix' is really more of a workaround...

Thanks for your response. I'll forward the changes you are making to the
Openldap CVS to the Globus folks.

- Gareth

Gareth S. Bestor, PhD.
IBM Poughkeepsie UNIX Development Lab
Bldg. 414, M/S P963
2455 South Road, Poughkeepsie, NY 12601-5400
(845) 433-6289, Tieline 293-6289, Fax (845) 433-8363


Howard Chu <openldap-its@OpenLDAP.org> on 06/17/2002 07:12:24 PM

To:    Gareth S Bestor/Poughkeepsie/IBM@IBMUS
cc:
Subject:    Re: send_search_entry aborts b/c ber_flush fails with errno=0
       (ITS#1891)


I have fixed the debug message in slapd/result.c:send_search_entry() and
changed
the while loop in liblber/io.c:ber_flush(). The changes are committed to
the CVS
HEAD. However, the code should never try to flush an empty buffer; every
code
path that drops into result.c:send_ldap_ber() (which invokes ber_flush)
should
have filled the ber structure with data. There is likely something else
going
wrong.

There are no references to EWOULDBLOCK in ber_flush, so I have ignored that
part
of your suggested fixes.