Skip to content

session: reap the process group when the kernel reaps the shell - #116

Open
team-humaki wants to merge 1 commit into
Daily-AC:mainfrom
team-humaki:session-reap-on-kernel-wait
Open

team-humaki wants to merge 1 commit into
Daily-AC:mainfrom
team-humaki:session-reap-on-kernel-wait

Conversation

@team-humaki

Copy link
Copy Markdown

Fixes #110

cmd.Wait reaps the shell and only then waits for output copiers (WaitDelay). In that window the pid — and the process-group id that is the same number — can already belong to someone else, while the container still names it.

Wait the process first, mark the container reaped, then let Wait finish copying. Kill after that is a no-op instead of a signal to a reused PGID.

go test ./internal/server/ -count=1 green.

cmd.Wait returns after I/O (WaitDelay). The pid is already gone by then.
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: reap() marks the group reaped after cmd.Wait, leaving a window where the old PGID is still signalled

1 participant