Skip to content

session: unblock a cancelled stdin write when the kill fails - #113

Open
team-humaki wants to merge 1 commit into
Daily-AC:mainfrom
team-humaki:session-cancel-stdin
Open

team-humaki wants to merge 1 commit into
Daily-AC:mainfrom
team-humaki:session-cancel-stdin

Conversation

@team-humaki

Copy link
Copy Markdown

A cancel that cannot kill the process group already cuts the output reader so the read phase returns. The submit phase was still stuck: writeCommand holds the session lock while blocked on a full stdin pipe, and Close waited for that lock before closing stdin.

cancelNow (and Close) now close stdin without taking the lock, so a blocked write returns. The kill error is still attached to ErrSessionCancelled.

Fixes #112

Closing the output reader only ends the read phase. A command still
blocked in writeCommand held the session lock, so Close could not
close stdin either. Cut stdin in cancelNow (and in Close, before the
lock) so a failed kill still returns.

Fixes Daily-AC#112
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Session cancel: when the kill fails, a request blocked writing the command to stdin never returns

1 participant