.
D 2009-07-25T13:19:52
J assignee andreas_kupries
J cmimetype text/plain
J comment attached\sis\san\sannotated\snarrative\slog\sof\san\sobserved\ssequence\sof\sinteractions\sby\sthe\srefchan\ssubsystem\sand\sthis\scode\shttp://code.google.com/p/wub/source/browse/trunk/Wub/Chan.tcl?r=1798\n\nA\sconnected\ssocket\sis\spassed\sas\sthe\s'chan'\sargument\sof\sChan\sconstruction,\swhich\sis\s[chan\screate]d\sas\sa\srefchan.\n\nIn\sthe\snarrative,\ssome\sdata\sis\s[read]\spursuant\sto\sa\s[readable]\sevent\son\sthe\sunderlying\ssocket.\s\sLess\sdata\sis\sreturned\sby\s[Chan\sread]\sthan\sis\srequested.\s\sA\sbuffer-full\sof\sdata\sis\srequested\s(4096\sbytes)\sbut\sonly\s1440\sbytes\sare\savailable.\n\nThe\sdata\sis\sprocessed\sby\sthe\sapplication,\swhich\sthen\sattempts\sto\s[read]\s(in\snon-blocking\smode?)\smore\sdata.\s\sThe\sapplication\suses\s[gets]\sto\sparse\sa\sprefix\sof\sthe\s1440\sbytes\swhich\sare\savailable,\sbut\sit\scertainly\sdoes\snot\sconsume\sthe\sentirety.\s\sIt\sattempts\sto\s[read]\ssome\s20Kb\smore.\n\nTcl\s[Chan\swatch]es\sthe\srefchan,\sand\ssoon\safter\scalls\s[Chan\sread]\sagain\s\sto\srequest\sanother\sbuffer-full\sof\sdata.\s\sThere\shas\sbeen\sno\sreadable\sevent\striggering,\snor\shas\s[chan\spostevent]\sbeen\scalled\sby\sChan.\s\sDespite\sthis,\sTcl\sattempts\sto\sread.\n\nWhen\sthere\sis\sno\sdata\savailable,\sas\sindicated\sby\sthe\sreturn\svalue\sof\s""\sfrom\s[Chan\sread]\supon\sthis\ssecond\sattempt,\sTcl\sindicates\s[eof]\son\sthe\srefchan.\n\nI\swould\shave\sexpected\sTcl\snot\sto\scall\s[Chan\sread]\suntil\safter\sa\s[chan\spostevent]\shad\sbeen\ssignalled\sto\sit\sby\sChan.\n\nObservations:\s\sThe\sbehaviour\sis\sintermittent,\sinsofar\sas\ssometimes\san\sidentical\ssocket\sinteraction\ssucceeds\s(though\srarely.)\s\sI\shave\sattempted\sto\sreproduce\sthe\sbehaviour\sin\sa\slocalhost-connected\ssocket,\sand\sfailed.\s\sI\sbelieve\sthis\sis\sbecause\sthe\ssecond\sand\ssubsequent\s[Chan\sread]s\ssucceed.\n\nI\sthink\sit's\slikely\sthat\sTcl\srefchan\sis\scalling\sthe\srefchan's\sread\smethod\sinappropriately,\sand\sthen\sinterpreting\sthe\s0-length\sresult\sas\send\sof\sfile\seven\sthough\sit\shas\sreceived\sno\sindication\sfrom\sthe\srefchan\sby\smeans\sof\spostevent\sthat\sit\scan\sexpect\sany\sdata\sto\sbe\savailable\sto\sread.\n
J foundin obsolete:\s8.6b1.1
J is_private 0
J priority 7\sHigh
J resolution None
J status Open
J submitter coldstore
J subsystem 25.\sChannel\sSystem
J title tcl\sincorrectly\sreports\seof\sto\sapplication
J type Bug
K 2827000fffffffffffffffffffffffffffffffff
U coldstore
Z 2efac8c9885f0bcd16d3e14277008713