Skip to content

fix: don't restart process plugins after shutdown - #1377

Merged
dsherret merged 1 commit into
mainfrom
fix/no-process-plugin-restart-after-shutdown
Oct 20, 2026
Merged

dsherret merged 1 commit into
mainfrom
fix/no-process-plugin-restart-after-shutdown

Conversation

@dsherret

Copy link
Copy Markdown
Member

When a process plugin was shut down while a format was in flight, the failed format would see the plugin as not alive (is_process_alive() returns false once the shutdown flag is raised) and restart it, spawning a new process right after shutdown.

This was the cause of the flaky should_support_shutdown_during_indefinite_host_formatting test: the restarted process would get torn down mid-startup when the runtime was dropped, hit EOF on stdin, and log Error: FormatError(Error { kind: UnexpectedEof, message: "failed to fill whole buffer" }), which the test environment then caught on drop.

The fix tracks a graceful shutdown in InitializedProcessPluginCommunicator and skips the restart in that case. A plain kill() still restarts the process (covered by should_handle_killing_process_plugin).

Added should_not_restart_process_plugin_after_shutdown, which deterministically checks that no new process is started after shutdown.

When a process plugin was shut down while a format was in flight, the
failed format would see the plugin as not alive (the shutdown flag is
raised) and restart it, spawning a new process right after shutdown.
This was also the cause of the flaky
`should_support_shutdown_during_indefinite_host_formatting` test where
the restarted process would get torn down mid-startup and log an
unexpected EOF error.
@dsherret
dsherret merged commit f3da7c8 into main Oct 20, 2026
9 of 21 checks passed
@dsherret
dsherret deleted the fix/no-process-plugin-restart-after-shutdown branch October 20, 2026 19:55
@dsherret

Copy link
Copy Markdown
Member Author

I have been wondering about this error for years lol

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.

1 participant