Skip to content

Conversation

christian-stephen
Copy link
Member

@christian-stephen christian-stephen commented Aug 25, 2025

⚙️ Issue

https://circleci.atlassian.net/browse/ONPREM-2536


⚙️ Change Description

There was a bug on Windows in the test to check for lingering child processes after task agent terminates. Once this test was fixed, it was revealed that child processes weren't getting destroyed as expected. This updates the cmd package to set up a job object for the task agent prcoess and its children so that they will destroyed accordingly.

Acceptance Criteria:


Solution


Testing

  • Created and updated tests where applicable

📖 Documentation Updates

  • Updated related documentation, if applicable
  • Updated changelog

pidCmd := "echo $$ >"
if runtime.GOOS == "windows" {
// https://stackoverflow.com/a/77115597
pidCmd = "ps -p $$ | awk 'NR ==2{print $4}' >"
Copy link
Member Author

@christian-stephen christian-stephen Sep 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was flaky since we weren't getting the PID correctly, so the lookup for lingering child processes "incorrectly" failed.

}

func (c *Command) start() error {
g, err := newProcessExitGroup()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@christian-stephen christian-stephen changed the title Fix child process cleanup on Windows [ONPREM-2536] Fix child process cleanup on Windows Sep 8, 2025
@christian-stephen christian-stephen marked this pull request as ready for review September 8, 2025 18:31
@christian-stephen christian-stephen requested a review from a team as a code owner September 8, 2025 18:31
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.

2 participants