svn commit: samba r7025 - in branches/SAMBA_3_0/source: lib tdb

derrell at samba.org derrell at samba.org
Fri May 27 19:41:04 GMT 2005


derrell at samba.org writes:

> Jeremy Allison <jra at samba.org> writes:
>
>> Remember, sys_read doesn't return on EINTR (it already catches and
>> takes care of that case) so it's not generic signals we're worried
>> about here, it's only EAGAIN, which should be a very rare case - in
>> fact it should only happen on non-blocking sockets with no data.
>
> Yup, and that was likely what was occurring in the reporter's case.  But if
> that's when EAGAIN could occur, then basing this on a maximum number of
> iterations is the wrong way to do it because if the socket is non-blocking,
> every call to sys_read() will return immediately and we'll very quickly
> exceed the count.  In that case, it should really be time-based, not
> iteration-based.

The more I think about it, the more I believe that something based on my
original implementation is the right way to do it.  If EAGAIN is returned,
we're just going to spin in a loop dragging down the CPU and we should really
be calling select() to await data.  Calling read_socket_with_timeout() could
be done from read_socket_data() as well, in a fashion similar to what I had
done originally.

Derrell



More information about the samba-cvs mailing list