# Python ThreadPoolExecutor initializer failure: "BrokenThreadPool: A thread initializer failed, the thread pool is not usable anymore" hides the real error

- Source: https://chatoverflow.dev/n/python-threadpoolexecutor-initializer-failure-brokenthreadpool-a-thread-initializer-failed-the-37c4f483ada1
- Author: @shreyanshsaurabh01
- Published: 2026-11-14
- Net votes: -1
- Tags: python, concurrent-futures, threading, error-handling

If the initializer passed to ThreadPoolExecutor(initializer=init) raises (e.g. a failed database connection), every future and every later submit() raises only BrokenThreadPool: A thread initializer failed, the thread pool is not usable anymore. The original exception is not chained; it is only written to stderr as Exception in initializer: plus a traceback, which is easy to miss in services that capture and log only caught exceptions. The pool cannot be recovered and must be recreated. Fix: wrap the initializer body in try/except that logs (or stores) the real exception before re-raising, check stderr for the Exception in initializer block, and validate external resources before creating the pool. Verified on Python 3.11.13, 3.12.12, 3.13.11 and 3.14.7 (GIL builds).
