Comments (2)
After some more digging, it seems that using the CTRL_BREAK_EVENT
signal is the right way to kill process groups on Windows. The following combination of scripts works:
pyscript.py
analogous to 'the framework', i.e.astrolabe
):
import subprocess
import os
import signal
import sys
import time
cmd = subprocess.Popen([sys.executable, "bgproc.py"],
creationflags=subprocess.CREATE_NEW_PROCESS_GROUP,
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
time.sleep(2)
os.kill(cmd.pid, signal.CTRL_BREAK_EVENT)
stdout, stderr = cmd.communicate(timeout=10)
print("stdout: {}".format(stdout))
print("stderr: {}".format(stderr))
print("exit code: {}".format(cmd.returncode))
bgproc.py
(analogous to a driver workload executor script):
import signal
print("hello world")
def cleanup(signum, frame):
print("caught ctrl-break!")
exit(0)
signal.signal(signal.SIGBREAK, cleanup)
while True:
pass
exit(0)
This works as expected:
$ C:/python/Python37/python.exe pyscript.py
stdout: b'hello world\r\ncaught ctrl-break!\r\n'
stderr: b''
exit code: 0
from drivers-atlas-testing.
With #32 and #30 done, this mostly boils down to document this change in the expected behavior of workload executors written for windows. Adding the documentation tag and updating the issue description accordingly.
from drivers-atlas-testing.
Related Issues (20)
- Consider defining the driver workload in its own file
- Implement Poller that retries endpoints when encountering some pre-specified Atlas API errors
- Fail the whole test run if the preparation steps failed
- Investigate why Atlas Group retrieval fails for some groups HOT 2
- Migrate to ubuntu1804-drivers-atlas-testing
- Workload executor validation evergreen task
- Add documentation for workload executor validation
- Support for workload executors that take a long time to start up
- Prepend environment variables used by astrolabe with ASTROLABE_*
- Only inject certifi certificates on Windows if using TLS HOT 2
- Astrolabe attempts reading the sentinel file before it is written on Windows HOT 1
- Add alternative mechanism to signals for stopping workload executors HOT 5
- Use Atlas test cluster to synchronize operations between astrolabe and workload executors
- Workaround hitting rate limits while polling Atlas API endpoints HOT 1
- Make validation a bit more forgiving HOT 1
- Bash scripts wrapping native workload executors need not run them as background processes
- Document that workload executors MUST ignore the testData key in the workload executor spec
- Astrolabe does not stop when cluster creation fails HOT 2
- Use cloud-dev Atlas for running Evergreen against drivers-atlas-testing HOT 1
- Migrate to using IP Access List endpoints
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drivers-atlas-testing.