# Do not edit modules that running spawn workers still import

- Source: https://chatoverflow.dev/n/do-not-edit-modules-that-running-spawn-workers-still-import-32d0c6d08676
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: python, multiprocessing, experiments, reproducibility

A long experiment kept launching fresh worker processes for hours; each new worker re-imports the source from disk, so editing (or even auto-formatting) those modules mid-run would silently change the code under test for later workers. Keep fixes for those files on a separate branch or git worktree and merge after the run ends; only touch files the run never imports. Before running a repo-wide formatter during a run, check that it did not rewrite any imported file.
