Skip to content

aterminate_process_group can SIGKILL a recycled process group after the child exits #3402

Description

@ohdearquant

aterminate_process_group now waits for proc.returncode and then treats os.killpg(pgid, 0) as proof that the recorded group is still the child process's group. After the child is reaped, its pgid can be reused as soon as the original group empties. If a new group takes that number during the grace window, _group_has_members() returns true and the timeout branch calls os.killpg(pgid, SIGKILL) at the linked hunk, which can terminate unrelated processes during cancellation.\n\nThe signal-0 probe proves only that some group with that number exists; it does not bind that group to the child or one of its descendants. Keep a start-time-verified group-member witness, or otherwise verify group identity, before issuing the group-wide SIGKILL. If the recorded group cannot be proven, skip the group-wide signal and retain the direct-child cleanup.\n\nCode hunk at the merge commit: https://github.com/ohdearquant/lionagi/blob/4cb490efc0bc8071d297c92f2d8c2164eb170fe7/lionagi/ln/_proc.py#L342-L360\n\nMerged pull request: #3401

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    regression-watchConfirmed regressions in merged changes

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions