<i>select notifier crashes/misbehaves on fd >= FD_SETSIZE</i> status still Open with 3 other changes
by
.
D 2019-11-05T19:57:06.242
J icomment Well,\sI\sthink\sI\sknow\swhat\scould\scause\sa\scrash:\sthe\stest-script\sis\sa\sbit\sweird,\sbecause\seven\sif\snoone\ssocket\sgets\saccepted,\sit\scan\sexplode\sendless\s"readable"\sevents\s(accept-events\sof\slistener),\sbut\sin\sstate\sof\sdescriptor\sexhaustion\saccept\scan't\screate\snew\ssockets.<br/>\r\n\r\nSuggested\sfix\sof\sme\scan\sindeed\s"solve"\sthat,\sbut\sunfortunately\sit\smarks\sthe\slistener\sas\suseless,\sbecause\sit\swould\snever\saccept\sanymore,\salso\sif\ssome\sfree\sdescriptors\swould\sarrive\s(sockets\sor\sfiles\sget\sclosed).\r\n\r\nProper\sfix\sshould\sretard\sreadable\sacceptor-handler\sof\slistener\sin\ssituation\sof\sENOBUFS/EMFILE\s(to\savoid\sendless\sbusy-wait),\sso\sit\swere\sable\sto\scontinue\slater,\sif\snew\sdescriptors\sarrive\s(accept\ssucceeds).\r\nUnfortunately\swe\sdon't\sreally\shave\sany\ssocket\sstate\sthat\scan\sbe\sused\sfor\ssuch\spurposes\sto\srecognize\sout\sof\slimit\sat\sscript\slevel\sor\sto\snotify\sconnecting\sasync\ssocket\sabout\s"too\smany\sopen\sfiles",\sbecause\snormally\sthis\ssocket\swould\sconnect\sto\sremote\slistener\s(other\sthread/process)\sand\s"accept"\sknows\sonly\scounterpart\sof\sconnection\s(which\sis\snot\sreally\sbuilt).\r\n\r\nIn\snormal\suse-case\sthe\saccept\swould\sfail\sif\slistener\sprocess\sexceeds\sthe\slimit\sof\smax\sfile\sdescriptors,\sso\sfor\sexample\sif\sTCP\sconnection\ssending\sa\sFIN\sto\sother\sside,\sat\sother\sconnection\send\swe'll\sget\sreadable\sevent\swith\sreject.\r\n\r\nAnyway,\sI\shave\sto\srewrite\smy\sfix\s(to\savoid\sperdition\sof\slistener).\sI'll\stry\sto\suse\ssomething\sother\sin\sorder\sto\savoid\sbusy-wait,\sas\swell\sas\sprovide\stest\scases\scovering\sboth\ssituation\s(errors\son\sEMFILE\sand\swork\scontinuation\safter\sclose\sof\ssome\sdescriptors).
J login sebres
J mimetype text/x-fossil-wiki
K c6897e6e6a8a65a995ec35c9c297b926bf1b6783
U sebres
Z a535c79fcfa4d378298964710cda0eab