Skip to content

Conversation

@acabarbaye
Copy link
Contributor

Description

  • Trying to solve how subprocesses are spawned so that their termination is done gracefully and no orphans are left hanging

Test Coverage

  • This change is covered by existing or additional automated tests.
  • Manual testing has been performed (and evidence provided) as automated testing was not feasible.
  • Additional tests are not required for this change (e.g. documentation update).

func setGroupAttrToCmd(c *exec.Cmd) {
c.SysProcAttr = &syscall.SysProcAttr{
HideWindow: true,
CreationFlags: syscall.CREATE_UNICODE_ENVIRONMENT | syscall.CREATE_NEW_PROCESS_GROUP,
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you comment a link to docs for these?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a link to Windows reference doc on this

isRunning atomic.Bool
command *command
processMonitoring *subprocessMonitoring
messsaging *subprocessMessaging
Copy link
Contributor

Choose a reason for hiding this comment

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

This was a great mistake

joshjennings98
joshjennings98 previously approved these changes Apr 3, 2024
@acabarbaye acabarbaye merged commit af984fc into master Apr 4, 2024
@acabarbaye acabarbaye deleted the cmd-hanging branch April 4, 2024 12:10
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.

3 participants