Skip to content
Tcl Source Code Artifact [61481bcaf8]
Login

Artifact [61481bcaf8]

Artifact 61481bcaf843bcd7f1429c60dad7d1f34ae6aafce26ac32ab6b87cc49f06f25f:

Ticket change [61481bcaf8] - Ticket [c6897e6e6a8a65a9|c6897e6e6a] <i>select notifier crashes/misbehaves on fd &gt;= FD_SETSIZE</i> status still Open with 3 other changes by sebres on 2019-11-06 15:27:13.
D 2019-11-06T15:27:13.013
J icomment Sure,\sit's\scorrect\sand\sI\scan\sfollow\syour\sexplanation\s(just\sthe\scrash\swas\seven\snot\sreproducible\sto\sme)...\r\n\r\nAnyway,\sthe\sbranch\sis\sextended\snow\sand\s[001f178818]\scontains\sa\sfirst\sshot\sof\sproper\sfix\sfor\sthis\s-\snow\sit\sretards\saccepting\sin\scase\sof\sout\sof\sFD\sbut\scontinue\sto\saccept\sif\ssome\sdescriptors\sarrive\sagain\s(gets\sclosed\slater).\r\n\r\nAs\swewll\sas\stest\scases\scovering\sboth\ssituations:\r\n\r\n\s\s\s\s-\s2.14\s-\sno\sfree\sFD\savailable<br/>\r\n\s\s\s\s-\s2.15\s-\sFD\slimit\sviolates\s(exceeds)\sFD_SETSIZE\r\n\r\nBoth\stests\scover\scontinuation\sof\saccept\sin\sserver-listener,\sif\sfree\sdescriptors\sbecome\savaialable\slater.\r\n\r\nI\ssee\spretty\swell\sa\sbusy\swait\sfor\sunpatched\s8.6\s(it\shangs\sthere)\sand\s4\stests\spassed\swith\smy\sbranch:\r\n<code><pre>\r\n\s\s\s\s$\s./tcltest\s../tests/all.tcl\s-file\ssocket.test\s-match\s'*-2.1[45]'\r\n\s\s\s\s...\r\n\s\s\s\sall.tcl:\s\s\s\s\s\s\s\sTotal\s\s\s169\s\s\s\s\sPassed\s\s4\s\s\s\s\s\s\sSkipped\s165\s\s\s\s\sFailed\s\s0\r\n</pre></code>\r\nNow\swhy\sit\sis\sa\sfirst\sshot:\salthough\sit\sproperly\sfixes\sthe\sissue\s(error\son\slimit\s&\scontinue\sto\saccept\slater),\sbut\sin\scase\sof\sNOFILE-limit\sexceeding\sFD_SETSIZE\sit\ssimply\srejects\sthe\sconnection\s(what\sis\snot\soptimal).<br/>\r\nBetter\swould\sbe\sto\sextend\snotifier\sor\sasync\sevent\shandling\sto\suse\sepoll/poll\s(for\sall\sfd's\s<code>fd\s>=\sFD_SETSIZE</code>)\sor\sto\srewrite\swaiting\sselect\sto\sa\sbit\shackish\ssolution\sfrom\s[https://stackoverflow.com/a/7977082/7161854|SO/a/7977082/7161854]\s(e.\sg.\s<code>FD_SET(fd%FD_SETSIZE,\s&fds_array[fd/FD_SETSIZE])</code>)\sand\sthen\sif\sit\sworks\sremove\sall\s3\sextra\sprevention\scodes\slike\s[/artifact/cb2b27ad5d7eff89?ln=1216-1222|cb2b27ad5d7eff89,\sline\s1216-1222]\sthat\sI\sused\sat\sthe\smoment\sagainst\sviolation\sof\sthe\sset-size\slimit.
J login sebres
J mimetype text/x-fossil-wiki
K c6897e6e6a8a65a995ec35c9c297b926bf1b6783
U sebres
Z 7b4a419177dcaf651e9954eb12bf2b2b