Skip to content

Retire replaced background worker pools without blocking - #407

Open
Apeksha9389 wants to merge 1 commit into
python-cachier:masterfrom
Apeksha9389:bugfix/shutdown-replaced-executor
Open

Apeksha9389 wants to merge 1 commit into
python-cachier:masterfrom
Apeksha9389:bugfix/shutdown-replaced-executor

Conversation

@Apeksha9389

@Apeksha9389 Apeksha9389 commented Oct 17, 2026 •

Copy link
Copy Markdown

Resetting the background worker pool currently abandons the previous executor without shutting it down. Retire that pool with shutdown(wait=False) after successfully creating its replacement, allowing running and queued cache calculations to finish while preventing further submissions to the old pool.

Fixes #404; addresses item 15 in #367.

Two regression tests verify that reset returns while old work is blocked, queued work still completes, the replacement accepts new work, the old pool rejects new submissions, and failed replacement creation preserves the usable original pool. The retirement assertion fails on master. The targeted worker/executor tests pass (5 tests).

Repository Ruff and formatting checks pass. Mypy matches master exactly: three existing SQL backend errors with the installed dependencies, no new diagnostics. Broader local-backend validation: 354 tests passed, 7 skipped, and 8 external-backend cases deselected. One subprocess test initially failed because the runner lacked python on PATH and was launched outside the repository; it passed when rerun from the repository with the virtual environment on PATH. Thus all 355 executed local tests passed across the suite and corrected-environment rerun. External database services were not exercised.

Prepared with AI assistance; behavior and regression tests were verified locally.

@Apeksha9389
Apeksha9389 requested a review from shaypal5 as a code owner October 17, 2026 13:30

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Retire the previous background worker pool when resetting the executor

1 participant