On Sun, Feb 16, 2020 at 08:43:20AM +0100, Bo Lorentsen <[email protected]> wrote:
> I have a callback that gets called on every accept (where I loop on EAGAIN
> to empty the backlog), and for each new socket I make an protocol structure

You mean loop while accept is successful?

> up to about 20k connections, and concurrency of 500 i gets a few sockets
> that I can't read from, at all. recv returns -1 and EAGAIN, but it never
> gets any data.

You should not get readyness events from libev for sockets and then have recv
return EAGAIN.

> Are there something I am not aware of, or have others seen something like
> this ? I really appreciate any comments, I have tried google and found
> nothing useful on this specific subject.

Well, this is not a very specific problem - for example, your code could
simply be buggy and confuse fds (i.e. read from the wrong fd, move fds
around and so on). Or it could corrupt ata structures (e.g. by modifying
or freeing in-use watchers). There could also be some network problem,
caused by an external setup - tcpdump'ing everything and later looking at
the actual traffic for the socket that failed to work can help find out
what is going on. netstat/ss can display socket buffers, which can tell
you where the missing data is, or if there actually is any data waiting
(for example, you could have wrongly read the data already).

You could try recompiling libev with e.g. -DEV_VERIFY=2 or even 3 and see
if that maybe catches an issue (although if what you describe is correct,
it will probably not catch anything).

Personally, I'd start with whichever is easier. There should be at least some
insight to be gained from tcpdump/netstat/EV_VERIFY.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      [email protected]
      -=====/_/_//_/\_,_/ /_/\_\

_______________________________________________
libev mailing list
[email protected]
http://lists.schmorp.de/mailman/listinfo/libev

Reply via email to