From aa70653065d218f8bf7e17597a60d250d0d796f2 Mon Sep 17 00:00:00 2001 From: Ed_ Date: Sun, 7 Jun 2026 01:35:32 -0400 Subject: [PATCH] add note --- src/io_pool.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/io_pool.py b/src/io_pool.py index 51c56d15..f05395c1 100644 --- a/src/io_pool.py +++ b/src/io_pool.py @@ -1,3 +1,19 @@ +"""Shared AppController I/O pool factory. + +Historical note: an earlier revision of this module registered an +``atexit.register(pool.shutdown, wait=False)`` handler here, mirroring +the conftest fix at commit 8957c9a5. That approach was reverted because +it does not solve the Ctrl+C hang in ``sloppy.py`` when a worker is +mid-task (e.g. a long-running Gemini/Anthropic HTTP request): atexit +handlers do not fire at all in that scenario, so the process still hangs +in ``ThreadPoolExecutor.__del__`` -> ``shutdown(wait=True)`` during +finalization. + +The production fix lives in ``AppController.__init__`` as a SIGINT +handler that drains the pool and calls ``os._exit(0)``, sidestepping +the broken finalization chain. See commit log for details. +""" + from concurrent.futures import ThreadPoolExecutor