question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Terminating subprocess on Windows when "running" is flaky

See original GitHub issue

“estrella”: “^1.4.0”,

This config:

estrella.build({
  watch: true,
  run: "node build/index.js" // this process not killing
})

Temporary solution:

let childProcess = null

estrella.build({
  onEnd: () => {
    if (childProcess) { 
      childProcess.kill('SIGINT')
    }

    childProcess = spawn('node', ['build/index.js'], {
      stdio: [process.stdin, process.stdout, process.stderr],
    })
  },
})

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MaxmaxmaximusAWScommented, May 13, 2021

Why you not use this code in windows platforms? =) This fix works on me:

let childProcess = null

estrella.build({
  onEnd: () => {
    if (childProcess) { 
      childProcess.kill('SIGINT')
    }

    childProcess = spawn('node', ['build/index.js'], {
      stdio: [process.stdin, process.stdout, process.stderr],
    })
  },
})

i can use WSL or WSL2 or docker or my macbook, but we need fix the bug, not hide the bug)

0reactions
rsmscommented, May 13, 2021

Ah, yeah you’re going to have some issues if the process is not responding to hangup or int signals. You could try WSL or run your build manually (either in a BAT script or from js in onEnd, but you’ll likely run into similar issues as with estrella using nodejs.)

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - subprocess: deleting child processes in Windows
Popen.terminate calls win32's TerminalProcess . However, the behavior I see is that child processes of the process I am trying to terminate are...
Read more >
Terminating a subprocess on Windows « Python recipes «
You can use this handle to terminate subprocesses using either ctypes or the pywin32 extensions. Python, 29 lines.
Read more >
517661 - Chromium Mojo Windows flaky apptests hangs - chromium
The thread running a test subprocess still won't join after calling Popen.kill(): Error: Test hung and could not be killed! This change should...
Read more >
Overall experience test is flaky on windows #81556
Expected state transitions: 0 NOW WAITING FOR> "Flutter run key commands. ... stdout: ready (process terminated with exit code 0) The subprocess terminated...
Read more >
ShellStepTest.abort flake on Windows
On CI I see a lot of flakes on Windows: ... script running ping every second in a loop was sent a termination...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found