Fix pkill patterns in CLAUDE.md to prevent killing Copilot Coding Agent#18653
Fix pkill patterns in CLAUDE.md to prevent killing Copilot Coding Agent#18653
Conversation
- Remove manual pkill commands from CLAUDE.md - Add automatic cleanup in run-dev-server.sh with safe patterns - Use specific patterns: mlflow.*server.*--dev, node.*react-scripts.*start, yarn.*start.*mlflow/server/js - These patterns avoid killing unrelated processes like CCA Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
- Use 'mlflow/server/js.*yarn.*start' to match node process running yarn-4.9.1.cjs - Use 'yarn.*--cwd.*mlflow/server/js.*start' to match yarn command - Tested against real yarn start process output - Patterns correctly avoid killing CCA and other unrelated processes Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
…r.sh (#18652) Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
- Remove obsolete 'yarn.*--cwd.*mlflow/server/js.*start' pattern - Update comment to reflect new (cd && yarn) command pattern - Pattern 'mlflow/server/js.*yarn.*start' still matches the spawned node process - Rebased on master to include PR #18652 changes Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
|
@copilot do we need pkill -f "node.*react-scripts.*start" || true? |
The yarn start command runs craco, not react-scripts directly. The pattern mlflow/server/js.*yarn.*start is sufficient to kill the dev server processes. Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
|
@Copilot Thank you for the contribution! Could you fix the following issue(s)? ⚠ Invalid PR templateThis PR does not appear to have been filed using the MLflow PR template. Please copy the PR template from here and fill it out. |
|
@copilot Can we define a helper function to simplify the code? |
Done. Extracted the cleanup logic into a |
|
@copilot did you push the previous change (kill_matching_processes)? |
Extract repetitive pkill logic into kill_matching_processes helper function. This makes the code more maintainable and easier to extend. Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds automatic cleanup of existing dev servers to the run-dev-server.sh script and updates the documentation to reflect this improvement. The changes eliminate the need for manual pkill commands before starting development servers.
- Introduced a reusable
kill_matching_processeshelper function - Added automatic cleanup of MLflow and yarn dev servers at script startup
- Updated documentation to remove manual cleanup steps and add clarifying comments
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| dev/run-dev-server.sh | Added helper function and automatic cleanup logic for existing dev servers using specific process patterns |
| CLAUDE.md | Removed manual pkill commands from documentation and added comments noting automatic cleanup |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Fix pkill commands in CLAUDE.md and run-dev-server.sh to prevent killing Copilot Coding Agent
Problem:
pkill -f "mlflow server" || true; pkill -f "yarn start" || truebefore starting dev serverspkill -9 -f "mlflow" || true; pkill -9 -f "yarn" || true; pkill -9 -f "node" || true, killing itself and causing hangsSolution:
CLAUDE.md
pkillcommands from dev server instructionsdev/run-dev-server.sh
mlflow.*server.*--dev- MLflow dev server onlymlflow/server/js.*yarn.*start- yarn processes from mlflow/server/js (matches spawned node process path)kill_matching_processeshelper function for better maintainabilityThese patterns won't match CCA's node processes or other unrelated yarn/node/python processes.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.