<i>windows: `socket -async localhost $port` can hang sporadically in gethostbyname</i>.
by
.
D 2020-08-10T15:38:12.330
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment Evaluation\sof\s<code>socket\s-async\s$host\s$port</code>\scan\shang\ssporadically\son\swindows.\r\nFurther\sinvestigation\sshows\sthat\sthis\sreally\shang\s(freezes\scompletely)\sin\s<code>CreateSocketAddress</code>\swhen\sexecuting\s<code>gethostbyname</code>.\r\nThis\sis\snot\sa\sresolve\sissue,\ssince\sit's\saffected\sby\slocalhost\salso\sand\sit\sdoes\snot\sreturn\safter\stimeout,\sso\scauses\stotal\sfreeze\sin\scalling\sthread.\r\n\r\nThe\sissue\sis\sextremely\ssporadic,\sbut\sit\sis\sbetter\sreproducible\son\sWindows\s10\sbox\swith\sseveral\stcl-workers\ssimultaneously\sexecuting\s<code>socket\s-async\slocalhost\s$port</code>\sin\sthe\scycle.\r\n\r\nI\sthink\sthis\scould\sbe\salso\sa\sreason\sfor\sother\ssporadically\shanging\sissues,\slike\s[e484a8407c]\sor\s[1adeb65446],\sat\sleast\spartially\s(for\stest\scases\sinvolving\ssocket\scalls).\r\n\r\nRelated\sto\s[https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-gethostbyname|MS\sdocumentation]:\r\n<i><blockquote>Developers\screating\sWindows\sSockets\s2\sapplications\sare\surged\sto\suse\sthe\s<code>getaddrinfo</code>\sfunction\sinstead\sof\s<code>gethostbyname</code>.</blockquote></i>\r\n\r\nAnd\ssince\s[7e814eaa84]\swe're\susing\sWinsock\s2.2\sAPI,\sit\smust\sbe\sfixed.<br/>\r\nAnyway\son\s8.6\susing\s<code>getaddrinfo</code>\sthis\sbehavior\sis\snot\sreproducible\sat\sall.
J foundin 8.5
J is_private 0
J login sebres
J priority 5\sMedium
J resolution None
J severity Critical
J status Open
J submitter sebres
J subsystem 25.\sChannel\sSystem
J title windows:\s`socket\s-async\slocalhost\s$port`\scan\shang\ssporadically\sin\sgethostbyname
J type Bug
K 7cf7cce42320c60ca3ed94c3ec59de1694a27f68
U sebres
Z 98acf8f62ef6073efab9386953a0ca03