Skip to content
Tcl Source Code Artifact [282c1a24d4]
Login

Artifact [282c1a24d4]

Artifact 282c1a24d460f8bbac9abf5bff7f43430d3b2e7e:

Ticket change [282c1a24d4] - New ticket [734138ded8cca190|734138ded8] <i>close does not report error which was saved by a failing background flush (socket-14.11.1)</i>. by oehhar on 2014-05-30 13:43:53.
D 2014-05-30T13:43:53.784
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment <h1>Symptom</h1>\r\n\r\nTest\ssocket-14.11.1\sfails\son\sWindows\sand\son\sLinux\swith\sa\slocalhost\sresolving\sto\s::1\sand\s127.0.0.1\r\n\r\n<h1>Issue</h1>\r\n\r\nWhen\sa\sbackground\sflush\s(for\sexample\sinvoked\sby\sa\sreported\swritable\sfileevent)\sfails,\sthe\serror\scode\sis\ssaved.\sIf\sthis\ssocket\sis\sclosed,\sthe\serror\sshould\sshow\sup.\r\n\r\n<h1>Demo</h1>\r\n\r\n<h2>Correct\sbehaviour</h2>\r\n\r\nVersion\s[9b3b3adf47]\s(before\scommit\sof\s[bug-13d3af3ad5])\sshowed\sthe\sIMHO\scorrect\sbehaviour.\r\n\r\nHere\sis\sa\slog\sin\sa\swindows\stclsh:\r\n\r\n<verbatim>\r\n%\sset\sh\s[socket\s-async\slocalhost\s30001]\r\nsock01AC6220\r\n%\sfconfigure\s$h\s-blocking\s0\r\n%\sputs\s$h\sHi\r\n%\sflush\s$h\r\n%\sfileevent\s$h\swritable\s{set\s::x\s1}\r\n%\svwait\sx\r\n%\sclose\s$h\r\nsocket\sis\snot\sconnected\r\n%\r\n</verbatim>\r\n\r\nWhat\shappens:\r\n\s\s\s*\s\s\sin\sthe\sfirst\srow,\sa\ssocket\sconnect\son\san\sunopened\sport\sis\sstarted\s(which\swould\stake\son\sa\ssyncroneous\sconnect\sup\sto\s10\sseconds\son\swindows\sto\sreport\s"connection\srefused"\sso\sthe\sfollowing\scommands\sare\sexecuted\swhile\sconnectiong).\r\n\s\s\s*\s\s\sthen\sit\sis\sset\sto\snon-blocking\sand\sa\swrite\sis\sissued.\r\n\s\s\s*\s\s\sThe\sdrivers\ssend\sroutine\sis\scalled\sand\sreturns\swith\s"EWOULDBLOCK"\r\n\s\s\s*\s\s\sfileevent\sand\svwait\swait\suntil\sthe\sconnect\sfails.\s\sThe\sfileevent\sreporting\sof\sthe\sdriver\sinvokes,\sthat\sthe\stclIO\swill\scall\ssend\son\sthe\sdriver\swhich\swill\sreport\s"socket\sis\snot\sconnected"\sposix\serror\scode.\sThis\sis\sstored\sby\stclIO\r\n\s\s\s*\s\s\sclose\sis\sexecuted.\sThe\ssocket\sis\scorrectly\sclosed\sand\sthe\sstored\serror\sis\sshown\sto\sthe\suser.\r\n\r\n<h2>Trunk\sbehaviour</h2>\r\n\r\nWith\sthe\scurrent\strunk,\sone\sgets:\r\n\r\n<verbatim>\r\n%\sset\sh\s[socket\s-async\slocalhost\s30001]\r\nsock01A26150\r\n%\sfconfigure\s$h\s-blocking\s0\r\n%\sputs\s$h\sHi\r\n%\sflush\s$h\r\n%\sfileevent\s$h\swritable\s{set\s::x\s1}\r\n%\svwait\sx\r\n%\sclose\s$h\r\n%\r\n</verbatim>\r\n\r\nSo,\sthe\serror\sdoes\snot\sshow\sup.
J foundin trunk
J is_private 0
J login oehhar
J priority 5\sMedium
J private_contact 0f366eb3e9e2fcab52b8ebacd197db9047186a5f
J resolution None
J severity Minor
J status Open
J submitter oehhar
J subsystem 25.\sChannel\sSystem
J title close\sdoes\snot\sreport\serror\swhich\swas\ssaved\sby\sa\sfailing\sbackground\sflush\s(socket-14.11.1)
J type Bug
K 734138ded8cca1906d920b837ec1cfd4bc811282
U oehhar
Z f440d17bd3f11290db0102005deb30c8