fix: terminate MLflow server when Caldera exits#8
Open
ChenFryd wants to merge 1 commit into
Open
Conversation
The MLflow server was started with subprocess.Popen() but the process reference was discarded, leaving it running as an orphan after Caldera shuts down. Store the Popen reference in _mlflow_proc and register an atexit handler that terminates it gracefully (with a 5-second timeout before force-kill) when the Caldera process exits.
|
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
hook.pystarted the MLflow server withsubprocess.Popen()but discarded the process reference,leaving MLflow running as an orphan after Caldera shuts down.
MLflow internally spawns worker processes via Python
multiprocessing. When the MLflow parent dieswithout cleanup, those workers get reparented to
init(PID=1) and continue listening on port 5000indefinitely. Repeated Caldera restarts accumulate these orphaned processes.
The fix stores the
Popenreference in_mlflow_procand registers anatexithandler(
_shutdown_mlflow) that callsterminate()on exit, with a 5-second timeout before forcekill().Closes #7
Type of change
How Has This Been Tested?
ss -tlnp | grep 5000ss -tlnp | grep 5000Checklist: