Summary#
Graceful teardown must own descendant processes and pending async work
Problem#
External GitHub PRs showed shutdown bugs when wrappers, PTY layers, or destructors assumed children and pending operations would stop themselves. That led to stuck shutdowns, orphaned work, or duplicate interrupts.
Solution#
Track the real process tree or pending-operation queue, then shut down in the correct ownership order: signal the effective child, drain pending operations before subsystem teardown, and keep platform-specific paths explicit. Add regression tests that simulate wrapper processes and delayed cleanup.
Failure Modes#
- Nested child processes survive after the parent exits
- Duplicate SIGINT delivery causes noisy or unsafe shutdown
- Destructor runs after required backend state is already gone
- Global worker threads keep binaries from exiting cleanly
Sources#
- https://github.com/tensorflow/tensorflow/pull/121411
- https://github.com/tensorflow/tensorflow/pull/121372
- https://github.com/tensorflow/tensorflow/pull/120325
- https://github.com/tensorflow/tensorflow/pull/121417
- https://github.com/tensorflow/tensorflow/pull/121265
- https://github.com/tensorflow/tensorflow/pull/121448
- https://github.com/tensorflow/tensorflow/pull/121421
- https://github.com/tensorflow/tensorflow/pull/121418
- https://github.com/tensorflow/tensorflow/pull/121453
- https://github.com/tensorflow/tensorflow/pull/121444
- https://github.com/huggingface/transformers/pull/46039
- https://github.com/huggingface/transformers/pull/46698
- https://github.com/huggingface/transformers/pull/46523
- https://github.com/huggingface/transformers/pull/46721
- https://github.com/huggingface/transformers/pull/46619
- https://github.com/huggingface/transformers/pull/46587
- https://github.com/huggingface/transformers/pull/46472
- https://github.com/huggingface/transformers/pull/46720
- https://github.com/huggingface/transformers/pull/46600
- https://github.com/huggingface/transformers/pull/46690
- https://github.com/huggingface/transformers/pull/46618
- https://github.com/microsoft/ML-For-Beginners/pull/978
- https://github.com/microsoft/ML-For-Beginners/pull/971
- https://github.com/microsoft/ML-For-Beginners/pull/967
- https://github.com/microsoft/ML-For-Beginners/pull/970
- https://github.com/ClickHouse/ClickHouse/pull/107755
- https://github.com/ClickHouse/ClickHouse/pull/107355
- https://github.com/ClickHouse/ClickHouse/pull/107291
- https://github.com/ClickHouse/ClickHouse/pull/107513
- https://github.com/ClickHouse/ClickHouse/pull/106957
- https://github.com/ClickHouse/ClickHouse/pull/100500
- https://github.com/ClickHouse/ClickHouse/pull/107625
- https://github.com/ClickHouse/ClickHouse/pull/107624
- https://github.com/ClickHouse/ClickHouse/pull/102064
- https://github.com/ClickHouse/ClickHouse/pull/105943
- https://github.com/ClickHouse/ClickHouse/pull/107704
- https://github.com/ClickHouse/ClickHouse/pull/107731
- https://github.com/ClickHouse/ClickHouse/pull/107729
- https://github.com/ClickHouse/ClickHouse/pull/102942
- https://github.com/vercel/turborepo/pull/13100
- https://github.com/vercel/turborepo/pull/13098
- https://github.com/vercel/turborepo/pull/13095
- https://github.com/vercel/turborepo/pull/13094
- https://github.com/vercel/turborepo/pull/13093
- https://github.com/vercel/turborepo/pull/13092
- https://github.com/vercel/turborepo/pull/13090
- https://github.com/vercel/turborepo/pull/13089
- https://github.com/vercel/turborepo/pull/13088
- https://github.com/vercel/turborepo/pull/13086
- https://github.com/vercel/turborepo/pull/13085
- https://github.com/vercel/turborepo/pull/13084
- https://github.com/vercel/turborepo/pull/13079
- https://github.com/vercel/turborepo/pull/13077
- https://github.com/vercel/turborepo/pull/13074
- mined_at: 2026-06-17T16:08:52Z
Sagwan Revalidation 2026-06-17T16:14:18Z#
- verdict:
ok - note: 프로세스 트리와 pending 작업을 명시적으로 정리하라는 권장은 여전히 유효함
Sagwan Revalidation 2026-06-18T17:00:56Z#
- verdict:
ok - note: 전날 검증 이후 일반 원칙·권장안·출처 모두 재사용 가능해 보임