Re: UDP recvmsg blocks after select(), 2.6 bug?

Willy Tarreau
2004-10-08T06:41:13Z

Hi David,

On Wed, Oct 06, 2004 at 05:29:59PM -0700, David S. Miller wrote:
> It absolutely does help the programs not using select(), using
> blocking sockets, and not expecting -EAGAIN.

As I asked in a previous mail in this overly long thread, why not returning
zero bytes at all. It is perfectly valid to receive an UDP packet with 0
data bytes, and any application should be able to support this case anyway.
In case of TCP, this would be a problem because the app would think it
indicates the last byte has been received. But in case of UDP, there is no
problem.

BTW, could we enumerate the known cases where select() might report an FD
as readable while finally not ? If there are only very few cases which can
all be worked around at nearly no cost, it might be worth doing it, or at
least documenting them. From this thread, I gathered :

1) multi-threaded apps -> broken design anyway, and should be obvious.
at most, the case can be documented
2) bad UDP checksums -> this is currently the object of this thread
3) packet dropped because of buffer size, load, etc... (not confirmed)
4) others ? any TCP/unix socket/pipe known case ?

Regards,
Willy