Skip to content

Make unexpected subprocess kills thread-safe. - #14592

Open
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl975832029
Open

Make unexpected subprocess kills thread-safe.#14592
copybara-service[bot] wants to merge 1 commit into
masterfrom
test/cl975832029

Conversation

@copybara-service

Copy link
Copy Markdown

Make unexpected subprocess kills thread-safe.

To kill the subprocess, we kill the syscall thread, which in turn kills all
stub threads by virtue of being their parent. This means we have two critical
sections that need to be protected:

  1. Creating new sysmsg threads -- the function expects that it's new baby
    will stay alive at least while it's being created;
  2. Using the syscall thread itself.

We also kick out any currently sleeping task goroutines, and put guard-checks
on wait loops and possible entrances to subprocess functionality so that tasks
don't come back to a dead subprocess.

Additionally, killed subprocesses were not properly decref'ed before, this CL
also fixes that.

@copybara-service copybara-service Bot added the exported Issue was exported automatically label Sep 3, 2026
To kill the subprocess, we kill the syscall thread, which in turn kills all
stub threads by virtue of being their parent. This means we have two critical
sections that need to be protected:
1. Creating new sysmsg threads -- the function expects that it's new baby
   will stay alive at least while it's being created;
2. Using the syscall thread itself.

We also kick out any currently sleeping task goroutines, and put guard-checks
on wait loops and possible entrances to subprocess functionality so that tasks
don't come back to a dead subprocess.

Additionally, killed subprocesses were not properly decref'ed before, this CL
also fixes that.

PiperOrigin-RevId: 975832029
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

exported Issue was exported automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant