Skip to content

fix(concore): let concorekill.bat match the node's script, so stop.bat stops Python nodes on Windows - #653

Closed
Siddhanthguptaa wants to merge 1 commit into
ControlCore-Project:devfrom
Siddhanthguptaa:fix/windows-stop-kill-filter
Closed

Siddhanthguptaa wants to merge 1 commit into
ControlCore-Project:devfrom
Siddhanthguptaa:fix/windows-stop-kill-filter

Conversation

@Siddhanthguptaa

Copy link
Copy Markdown

Fixes #652

concorekill.bat only killed a registered PID if its command line contained "concore", but a node runs as "...\python.exe" "controller.py", so stop.bat skipped every node. The script now checks for the node's own script name (basename of sys.argv[0], e.g. controller.py), matched literally with findstr /i /l /c:; it falls back to "concore" if there's no .py script name or the name isn't ASCII (the .bat is written in the system code page). PIDs are still only killed if the process looks like that node.

This has to touch concore.py because that's where the kill script is generated (_write_kill_script).

Tests

  • test_write_kill_script_generates_bat_file now checks the generated filter for controller.py (runs on any OS).
  • test_kill_script_kills_concore_process (Windows only) now runs a real python controller.py that registers its own PID, like a node does. Before, it started python -c "..." concore_node, which put "concore" on the command line and hid the problem.
  • Both fail on current dev and pass with this change. pytest on Windows 11 / Python 3.11: 238 passed, 12 skipped; ruff check/format pass.

Manual on Windows 11 (demo/sample, maxtime.bat 100000, with #639 so run.bat starts the nodes): before, stop.bat printed "Skipping PID ... not a concore process" for both nodes and they kept running; after, it prints "Killing concore process " for both and no node processes are left.

Not in this PR: concore.java has the same findstr /i "concore" check — I can send that as a separate Java-only PR.

concorekill.bat only killed PIDs whose command line contained
"concore", but nodes run as `python controller.py`, so stop.bat skipped
every node on Windows. Match the node's own script name instead (falling
back to "concore"), and make the Windows test start a real node script
that registers its own PID.
@Siddhanthguptaa

Copy link
Copy Markdown
Author

Closing for now to keep my open PRs to a number I can follow up on properly. Happy to reopen if this is wanted.

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