Artifacts Associated With Ticket 2b6b0a
Ticket change [7d7a6294d9] (rid 258296) by serhiy.storchaka on 2026-10-16 21:22:15:
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
After <nowiki>[chan close $chan write]</nowiki> on a non-blocking channel with output still queued, the channel stays writable until the background flush finishes: <nowiki>[puts]</nowiki> is accepted and the data is sent after the half-close. <verbatim> set p [open |[list [info nameofexecutable] child.tcl] r+] ;# child reads stdin later fconfigure $p -blocking 0 puts -nonewline $p [string repeat a 1000000] chan close $p write ;# returns at once, output still pending puts $p AFTER ;# no error; the child receives "AFTER" </verbatim> A blocking channel gives "channel wasn't opened for writing". CloseWrite() sets CHANNEL_CLOSEDWRITE, but TCL_WRITABLE is reset only when the flush completes (CloseChannelPart), and neither Tcl_GetChannelMode() nor CheckChannelErrors() looks at CHANNEL_CLOSEDWRITE. Seen with pipes and sockets.
- foundin initialized to: "8.6.18, 9.0.5, 9.1.0"
- login: "serhiy.storchaka"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "serhiy.storchaka"
- subsystem initialized to: "25. Channel System"
- title initialized to:
writes accepted after non-blocking chan close write
- type initialized to: "Bug"
Ticket change [8607a861af] (rid 258302) by serhiy.storchaka on 2026-10-16 21:29:43:
- icomment:
Proposed fix in branch [/timeline?r=chan-close-write-pending|chan-close-write-pending]: Tcl_GetChannelMode() does not report the write side once it is closed, so <nowiki>[puts]</nowiki> and a second <nowiki>[chan close $chan write]</nowiki> fail as for a blocking channel; the queued output is still flushed. Test iocmd-7.6.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [bc99893964] (rid 261980) by jan.nijtmans on 2026-11-20 16:41:51:
- assignee changed to: "aku"
- closer changed to: "nobody"
- comment changed to:
After <nowiki>[chan close $chan write]</nowiki> on a non-blocking channel with output still queued, the channel stays writable until the background flush finishes: <nowiki>[puts]</nowiki> is accepted and the data is sent after the half-close. <verbatim> set p [open |[list [info nameofexecutable] child.tcl] r+] ;# child reads stdin later fconfigure $p -blocking 0 puts -nonewline $p [string repeat a 1000000] chan close $p write ;# returns at once, output still pending puts $p AFTER ;# no error; the child receives "AFTER" </verbatim> A blocking channel gives "channel wasn't opened for writing". CloseWrite() sets CHANNEL_CLOSEDWRITE, but TCL_WRITABLE is reset only when the flush completes (CloseChannelPart), and neither Tcl_GetChannelMode() nor CheckChannelErrors() looks at CHANNEL_CLOSEDWRITE. Seen with pipes and sockets.
- icomment: "Merged to [a98d8d4e44|trunk]."
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [9e463c5705] (rid 262029) by jan.nijtmans on 2026-11-22 22:55:52:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2461367.4554717359"
- closer changed to: "jan.nijtmans"
- icomment:
Merged to [a98d8d4e44|trunk], core-9-0-branch and core-8-6-branch Many thanks!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"