Tcl Source Code

Artifact [0b239b3cf9]
Login
EuroTcl/OpenACS 11 - 12 JULY 2024, VIENNA

Artifact 0b239b3cf99b07d30364f905b2426306b407709ac3b984a073556d6f495b314f:

Ticket change [0b239b3cf9] - Ticket [de232b49f2] write-only nonblocking refchan and Tcl internal buffers status still Open with 3 other changes by apnadkarni 2024-04-08 15:10:50.
D 2024-04-08T15:10:50.376
J icomment Nathan,\r\n\r\nStarting\swith\syour\slast\scomment,\r\n\r\n*I\sthink\sone\sthing\swe\scan\sall\sagree\son\sis\sthat\sif\sa\sdevice\ssignals\sthat\sits\r\nready\sfor\sa\swrite...*\r\n\r\nTo\sexpand\son\sthat,\sI\sthink\swe\scan\sall\sagree\snone\sof\sthe\scurrent\sproposals\sare\r\nideal.\sMy\sconcern\swith\sa\sbroader,\s"better"\ssolution\shas\salways\sbeen\sone\sof\r\ntiming\sw.r.t\s9.0\srelease.\sI\shave\sreiterated\smy\sconcerns\swith\sthe\scurrent\r\nimplementation\soften\senough.\sAlternative\s(1)\sbelow\sseems\sless\srisky\sin\r\ncomparison\sto\sa\smore\scomplete\ssolution\sbecause\sof\s8.6\shistory\s(notwithstanding\r\nany\sthe\sother\srefchan\sbugs,\srestricting\sdiscussion\sto\sthe\sissue\sin\sthis\sticket).\r\nSimilarly,\salternative\s(2)\sbelow\sseems\sless\srisky\sbecause\sthe\schannel\ssubsystem\r\nmust\sin\sany\scase\sbe\spresumed\sto\swork\scorrectly\swith\s-buffering\snone.\sIf\sit\sdoes\r\nnot,\sthat\sis\ssomething\sto\sbe\sfixed\sirrespective\sof\srefchans\sor\sanything\selse.\sIf\r\nsomeone\shas\sthe\stime\sto\swork\sthrough\sthe\sdetails,\sand\ssufficient\sreview,\sa\smore\r\ncomplete\ssolution\sis\scertainly\ssomething\sdesirable.\sI\sjust\sdo\snot\swant\sto\shold\r\nup\s9.0\sfor\sthis\sideal\sscenario.\sIf\syou\stake\sa\sstab\sat\sthis\s(I'm\sstill\r\nprioritizing\sgetting\smy\sextensions\sand\sdistributions\s9.0-ready),\sit\swould\r\ncertainly\sbe\sa\sworthwhile\sexercise.\r\n\r\nAs\sto\sthe\sother\spoints,\r\n\r\nNathan\swrote\s*If\syou\scan\seliminate\sthat\stimer\swithout\sbreaking\sanything,\sthan\r\nplease\sdo!\sWhat\sI'm\sarguing\sagainst\sis\sjust\sreverting\sthis\schange\swithout\r\nproviding\sany\sother\sfix,\sand\swithout\seven\sproviding\san\sexample\sof\ssomething\sthat\r\nis\sbroken\sand\scan't\sbe\sfixed\sby\sany\sof\sthe\sexisting\sknobs.*\r\n\r\nI\salready\ssuggested\stwo\ssolutions\r\n\r\n1.\sFor\sthe\srefchan\sto\sgenerate\sthe\sevent\s(off\sa\stimer).\sWhy\sis\sthis\sbetter\sthan\r\nthe\sway\sit\sis\sdone\scurrently\swithin\sthe\schannel\score?\sBecause\s(a)\sthe\srefchan\r\nhas\sbetter\sinformation\sabout\sconnection\sstate,\sand\s(b)\sit\sonly\saffects\srefchans\r\nwhere\sthis\sis\sneeded,\snot\sALL\schannels\s(refchans\sor\snot).\r\n\r\n2.\sImplicitly\ssetting\s-buffering\snone\son\srefchans.\r\n\r\nI\salready\sstated\sneither\sis\sideal,\sI\sprefer\s(1),\sbut\sboth\sare\sbetter\sthan\swhat\swe\r\ncurrently\shave.\r\n\r\nI\sam\swaiting\sfor\syou\sto\sspecifically\sstate\swhat\sbreaks\swith\seither\sof\sthe\sabove\r\nor\sat\sleast\ssome\stechnical\sreasons\sin\sopposition.\sThe\stwo\sobjections\sI\shave\sheard\r\nare:\r\n\r\n-\s*That\swould\sbe\sa\sknee-jerk\sreaction\sto\sa\sparticular\sproblem\srather\sthan\sa\r\nwell-considered\sdesign*.\r\n\r\n-\sParaphrasing\smy\sunderstanding\sof\syou\sstated,\s*Scripts\sshould\snot\sbe\sburdened\r\nwith\sthe\sresponsibility*.\r\n\r\nWith\sregards\sto\sthe\sfirst,\sit's\sdifficult\sfor\sme\sto\stranslate\san\sopinion\sto\sa\r\nbroken\sbehaviour\sor\stechnical\sobjection\sI\scan\srationally\sdiscuss.\r\n\r\nWith\sregard\sto\sthe\ssecond,\sif\sthe\srefchan\sis\simplemented\sin\r\nscripts,\sonly\sthe\sscript\sknows\schannel\sstate,\sand\s**must**\sown\sthe\r\nresponsibility\sof\sgenerating\sevents.\sEven\swith\srefchan\senhancements,\sthis\swould\r\nstill\sbe\strue;\sthe\score\scould\sgenerate\sevents\sbut\sthe\sinformation\sabout\sstate\r\nwould\sstill\shave\sto\sbe\sprovided\sby\sthe\srefchan\sthrough\san\senhanced\sAPI.\r\n\r\nMoreover,\syour\scomments\son\show\stwapi\sor\s14.11\sor\sport\sscanners\suser\scode\sshould\r\nbe\swritten\sactually\s**burdens\sscripts\swith\schanging\svalid\scode\sto\sworkaround\sthe\r\nbugs\sintroduced\sby\san\sattempt\sto\sreduce\stheir\sburden**!\sThe\sirony!\r\n\r\nNathan\swrote\s*The\sproblem\sis\sthat\sTcl\swrites\sto\sa\sbuffer\swithout\sactually\r\ncalling\sthe\s[write]\sprocedure\sthat\sa\srefchan\sprovides.*\r\n\r\nYes,\sand\s-buffering\snone\son\srefchans,\simplicitly\sor\sexplicitly,\sforces\sthat\r\nwrite,\sthereby\sresolving\sthe\sissue\sfor\srefchans!\r\n\r\nNathan\swrote:\s*No\sone\shas\smade\stest\sio-14.11.0\sreliably\sfail\sin\sthe\serror\scase,\r\nso\sit's\scurrently\snot\sa\smeaningful\stest.*\r\n\r\nI've\salready\scommented\son\sthis\s"meaningful"\scriterion\sfor\stests\sin\r\n[b7f4b5a3f4](https://core.tcl-lang.org/tcl/info/b7f4b5a3f4a34b37).\sIf\swe\r\nhave\sdifferent\sopinions\sof\swhat\sa\smeaningful\stest\sis,\sso\sbe\sit.\sI\swill\r\ngive\sanother\sexample\sof\swhere\ssocket\sconnection\sopen\schecks\sare\simportant\r\n**before**\sdoing\sany\sI/O\son\sthe\schannel\s(as\sin\ssome\sof\syour\sexamples\sthat\r\ndo\sputs).\sApplications,\sfor\sexample,\smay\swant\sto\sprotect\sagainst\sDNS\sspoofing\r\nwith\sreverse\sDNS\slookups.\sThis\smust\sbe\sdone\sbefore\s**any*\sio\son\sthe\schannel,\r\nincluding\soutput.\sWhen\sthe\sconnection\sopen\snotification\sis\sreceived,\sthe\r\npeer\saddress\smust\sbe\savailable.\sThis\swill\snot\swork\swith\spremature\sconnection\r\nopens.\s(I\sunderstand\syou\sproposed\sbuffer\schecks\smay\sfix\sthis\spremature\r\nnotification\sproblem\sbut\swant\sto\sinsist\s14.11\snot\sbe\sdismissed\sas\smeaningless\r\nin\sits\sintent\sor\sits\simplementation.)\r\n\r\nNow\scoming\sto\sthose\sadditional\sproposed\sbuffer\schecks,\r\n\r\nNathan\swrote\s*The\stimer\scan\sbe\sconstrained\sto\scases\swhere\sa\swrite\s(perhaps\sonly\r\nto\sa\sbuffer)\shas\salready\soccurred\sand\san\sunfilled\sbuffer\sexists.*\r\n\r\nI\ssaw\sthat\sin\scommit\r\n[70a407c245](https://core.tcl-lang.org/tcl/info/70a407c2453e5aa3).\s(I\smissed\sthe\r\ncomment\sin\ssome\sother\sticket;\sone\sconsequence\sof\sdiscussion\sbeing\sspread\sacross\r\nthree\stickets).\sI'm\safraid\sthis\sonly\sillustrates\sthe\sproblem\swith\sthe\scurrent\r\ndesign.\sIt\sforces\sthe\schannel\score\sto\s**attempt\sto\sdeduce\sinformation\sit\sdoes\r\nnot\shave**.\sHere\sit\sis\sattempting\sto\sfigure\sout\schannel\sstate\sbased\son\sbuffer\r\nstate.\sNot\sonly\sis\sthis\sjust\sa\s"guess",\syou\shave\snow\smade\sevent\sgeneration\sa\r\ndependency\son\sthe\sbuffer\smanagement\scode.\sA\schange\sto\spreallocate\schannel\r\nbuffers,\sfor\sexample,\swould\sbreak\sthis\s"guess".\sIn\sSE\sterms,\shigh\scoupling\r\nbetween\scomponents\sthat\sare\sconceptually\sindependent.\sThis\sis\snot\sgood\sdesign\r\nfor\smaintainability.
J login apnadkarni
J mimetype text/x-markdown
K de232b49f26da1c18e07513d4c7caa203cd27910
U apnadkarni
Z b32deade38a3055d9cacc135c589962a