Skip to content
Tcl Source Code Artifact [80f195957d]
Login

Artifact [80f195957d]

Artifact 80f195957dd02299a8732592cda690cbaad70b88:

Ticket change [80f195957d] - Open ticket [2911139fffffffff|2911139fff]: <i>http::geturl abuses vwait on async call</i> plus 10 other changes by stwo on 2013-09-07 17:49:26.
D 2013-09-07T17:49:26.101
J assignee aku
J closer nobody
J comment Hi,\r\nAs\sdiscussed\son\sIRC\swith\ssome\sof\syou,\saMSN\skeeps\scrashing\sbecause\sof\s"too\smany\snested\sevaluations",\sand\sit\sseems\sto\sbe\scaused\sby\sa\snested\sevent\sloop\sby\scalling\supdate/vwait/tkwait.\sI\sfound\sout\swhat\sthe\scause\sis\sand\sit\sseems\sto\sbe\scoming\sfrom\sthe\shttp\spackage.\r\nI'll\sjust\scopy/paste\swhat\sI\ssaid\son\sIRC,\sand\sI'll\sattach\sa\stest\stcl\sfile\sto\sreproduce\sthe\sproblem\s:\r\n\r\n==========================================================\r\n<KaKaRoTo>\sit\sbasically\ssimulates\ssomeone\swho\stries\sto\sdo\s100\sgeturls\sasynchronously,\sand\sthey're\sall\sbeing\sdone\sfrom\sa\stimer\swhere\sthe\sgeturl\sgets\scalled\safter\sa\ssimple\sexecution\sstack\sof\smaybe\s5\sfunctions...\r\n<KaKaRoTo>\swith\smsn\sI\shave\sto\sdo\sa\sSOAP\s(http)\srequest\sfor\severy\scontact,\sso\sif\syou\shave\s200\scontacts,\sI'd\sdo\s200\sgeturls..\s\r\n<KaKaRoTo>\sI\sdefinitely\swant\sthe\sgeturl\sto\sbe\sasync!\sthat's\swhy\sI\sdo\s-timeout\sto\sthe\sgeturl,\sbut\sdoing\sso\smakes\shttp\sdo\sa\svwait,\swhich\scauses\sthe\sabove\serror\r\n<KaKaRoTo>\s(ps\slaunch\sthe\sscript\swith\s'wish\stst.tcl',\sif\syou\sjust\sdo\stclsh,\sit\swill\send\sbecause\sthere's\sno\smainloop)\r\n[...]\r\n\r\n<ijchain>\s<kbk>\sKaKaRoTo\s-\sDon't\sDo\sThat.\sUse\sthe\s-command\soption\sto\shttp::geturl\sso\sthat\sit\sdoesn't\sblock\r\n<KaKaRoTo>\skbk:\sI\suse\s-command\sAND\s-timeout\r\n<KaKaRoTo>\sif\s-timeout\sis\snot\sspecified\sthen\shttp\swill\snot\screate\sthe\ssocket\swith\s-async\r\n<KaKaRoTo>\sI\swas\sexpecting\smy\s-command\sto\sget\scalled\sif\sa\sconnection\serror\shappens,\sor\sif\sthe\stimeout\swas\sreached\sand\sthe\shttp\srequest\swas\snot\scompleted\r\n<KaKaRoTo>\sI\sdon't\sunderstand\swhy\s-timeout\swould\smake\sit\sasync\sAND\smake\sit\svwait...\s\r\n<ijchain>\s<kbk>\sLooking\sat\sthe\scode\s--\r\n<ijchain>\s<kbk>\sthe\sonly\s'vwait'\sis\sin\s'http_wait':\r\n<ijchain>\s<kbk>\sand\sthe\sonly\scall\sto\shttp_wait\sis\sgated:\r\n<ijchain>\s<kbk>\s\s\s\s\sif\s{!\s[info\sexists\sstate(-command)]}\s{\r\n<ijchain>\s<kbk>\s\shttp_wait\s$token\r\n<ijchain>\s<kbk>\s\s\s\s\s}\r\n<KaKaRoTo>\skbk:\sthere's\sanother\sone\r\n<KaKaRoTo>\sthere\sare\stwo\scalls\sto\s'wait'\sin\sthe\sgeturl\sfunction\r\n<KaKaRoTo>\s\s\s\s\s#\sWait\sfor\sthe\sconnection\sto\scomplete\r\n<KaKaRoTo>\s\s\s\s\sif\s{$state(-timeout)\s>\s0}\s{\r\n<KaKaRoTo>\s\sfileevent\s$s\swritable\s[list\shttp::Connect\s$token]\r\n<KaKaRoTo>\s\shttp::wait\s$token\r\n<ijchain>\s<kbk>\sugh\s-\sI'm\slooking\sat\sthe\swrong\shttp.tcl,\ssec...\r\n<KaKaRoTo>\skbk:\snp\r\n<KaKaRoTo>\swe\suse\shttp\s2.4.4,\sbecause\swe\shad\sproblems\swith\searlier\sversions,\sso\speople\supgrade\stheir\ssystem,\samsn\sstops\sworking\setc..\sso\swe\sbundle\s2.4.4\sand\sdo\sa\spackage\srequire\s-exact\s2.4.4\r\n<KaKaRoTo>\sbut\sI\schecked\sthe\sversion\sin\sCVS\sand\sit\shas\sthe\ssame\scode\r\n<ijchain>\s<kbk>\sKaKaRoTo\s-\sLog\sa\sbug.\sThis\scan't\sbe\sright.\r\n==========================================================\r\n\r\nSo,\sas\sexplained,\sin\smy\sopinion,\sthe\shttp::geturl\sshould\suse\s-async\son\sthe\ssocket\sif\s-command\sis\sspecified,\sit\sshould\salso\scall\sthe\scallback\scommand\sin\scase\sof\sa\sconnection\serror\sinstead\sof\svwait-ing\sin\sgeturl\sto\sreturn\san\serror.\r\n\r\nI\shope\sthis\sgets\sfixed\ssoon...\saMSN\sis\sbasically\scompletely\sbroken\sfor\severyone\sbecause\sof\sthis.\r\n\r\nThanks,\r\nKaKaRoTo
J foundin current:\s8.5.15
J icomment Still\sa\sproblem\swith\s8.5.15rc0\sand\s8.6.1rc0.
J login stwo
J mimetype text/plain
J resolution Remind
J severity Minor
J status Open
J username stwo
K 2911139fffffffffffffffffffffffffffffffff
U stwo
Z 3d42d856a70fc3605ae46f28ab824fd9