Skip to content

Make MLflow port configurable and prevent killing non-MLflow processes#14

Open
deacon-mp wants to merge 1 commit into
mainfrom
fix/mlflow-port-safety
Open

Make MLflow port configurable and prevent killing non-MLflow processes#14
deacon-mp wants to merge 1 commit into
mainfrom
fix/mlflow-port-safety

Conversation

@deacon-mp

Copy link
Copy Markdown
Collaborator

Summary

  • Prevent killing non-MLflow processes: kill_existing_mlflow() now checks that a process's command line contains "mlflow" before killing it, instead of blindly killing any process on the port.
  • Configurable port: The MLflow port is now read from the MCP_MLFLOW_PORT environment variable (default: 5000), replacing all hardcoded 5000 references.
  • Consistent logging: Replaced print() calls with log.info() / log.warning() for proper log integration.

Test plan

  • Verify MLflow starts correctly on the default port (5000)
  • Set MCP_MLFLOW_PORT=5001 and verify MLflow starts on port 5001
  • Confirm that non-MLflow processes on the configured port are not killed
  • Confirm that stale MLflow processes on the configured port are still killed

🤖 Generated with Claude Code

The hook.py kill_existing_mlflow() function previously killed any process
on port 5000 without verifying it was MLflow. This change:
- Checks process cmdline contains 'mlflow' before killing
- Makes the port configurable via MCP_MLFLOW_PORT env var
- Replaces hardcoded port references with the configurable value

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

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

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant