Skip to content

Fix Windows controller process cleanup - #657

Open
luqq-md wants to merge 1 commit into
ControlCore-Project:devfrom
luqq-md:dev
Open

luqq-md wants to merge 1 commit into
ControlCore-Project:devfrom
luqq-md:dev

Conversation

@luqq-md

@luqq-md luqq-md commented Nov 8, 2026 •

Copy link
Copy Markdown

Closes #652

WHAT WAS THE ISSUE?

I was exploring the Windows shutdown process and noticed that some Python and Java controllers were not being stopped properly.
After investigating, I found that the generated concorekill.bat script was checking whether a process's command line contained the word concore. However, controllers launched with normal Python or Java commands don't necessarily have that in their command line.
Because of this, valid controller processes were being skipped during shutdown.

WHAT DID I CHANGE?

I updated the way Python and Java register their processes. Instead of storing only the PID, they now also store the process start time.
I added a shared PowerShell helper (concorekill.ps1) that checks whether the registered PID and start time match the actual process before terminating it. This also helps prevent accidentally killing an unrelated process if Windows reuses a PID.
I also updated the Windows study generation scripts to include this helper in Python and Java node directories.
For older PID-only registry entries, the existing validation approach is retained for backward compatibility.

Failed cleanup attempts are preserved in the registry so they can be retried

TESTING

I tested the changes on Windows:

  • All 55 Python tests passed.
  • All 127 existing Java tests passed.
  • Verified that a real registered Python controller is terminated successfully.
  • Verified that a real registered Java controller is terminated successfully.
  • Checked PowerShell syntax and Python compilation.
  • git diff --check passed.
Screenshot 2026-11-08 094143

IMPACT

Windows can now identify and stop registered Python and Java controllers more reliably, while reducing the risk of terminating unrelated processes.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

🎉 Welcome aboard, @luqq-md! Thank you for your first pull request in concore.

Please ensure that you are contributing to the dev branch.

Your contribution means a lot to us. We'll review it shortly.

Please ensure you have reviewed our:

If you have any questions, feel free to ask. Happy coding!

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