Overview
| Artifact ID: | 34286348a64ddea87ee3e43374608196098e8c2aad38e0678b039869524cbd10 |
|---|---|
| Ticket: | c6897e6e6a8a65a995ec35c9c297b926bf1b6783
select notifier crashes/misbehaves on fd >= FD_SETSIZE |
| User & Date: | sebres on 2019-11-05 19:57:06 |
Changes
- icomment:
Well, I think I know what could cause a crash: the test-script is a bit weird, because even if noone socket gets accepted, it can explode endless "readable" events (accept-events of listener), but in state of descriptor exhaustion accept can't create new sockets.<br/> Suggested fix of me can indeed "solve" that, but unfortunately it marks the listener as useless, because it would never accept anymore, also if some free descriptors would arrive (sockets or files get closed). Proper fix should retard readable acceptor-handler of listener in situation of ENOBUFS/EMFILE (to avoid endless busy-wait), so it were able to continue later, if new descriptors arrive (accept succeeds). Unfortunately we don't really have any socket state that can be used for such purposes to recognize out of limit at script level or to notify connecting async socket about "too many open files", because normally this socket would connect to remote listener (other thread/process) and "accept" knows only counterpart of connection (which is not really built). In normal use-case the accept would fail if listener process exceeds the limit of max file descriptors, so for example if TCP connection sending a FIN to other side, at other connection end we'll get readable event with reject. Anyway, I have to rewrite my fix (to avoid perdition of listener). I'll try to use something other in order to avoid busy-wait, as well as provide test cases covering both situation (errors on EMFILE and work continuation after close of some descriptors).
- login: "sebres"
- mimetype: "text/x-fossil-wiki"