Skip to content

Commit ed17e4b

Browse files
committed
switch to thread
Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
1 parent 9a28660 commit ed17e4b

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
## [Unreleased][]
44

5-
[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-addons/compare/0.8.0...HEAD
5+
[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-addons/compare/0.8.1...HEAD
6+
7+
## [0.8.1][]
8+
9+
[0.8.1]: https://github.com/chaostoolkit/chaostoolkit-addons/compare/0.8.0...0.8.1
10+
11+
### Changed
12+
13+
- Switched to regular thread to check if must interrupted as the future
14+
executor is bit painful when it comes to exiting the program
615

716
## [0.8.0][]
817

chaosaddons/controls/safeguards.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def prepare(self, probes: List[Probe]) -> None:
151151
self.now = ThreadPoolExecutor(max_workers=now_count or 1)
152152
self.once = ThreadPoolExecutor(max_workers=once_count or 1)
153153
self.repeating = ThreadPoolExecutor(max_workers=repeating_count or 1)
154-
self.interrupter = ThreadPoolExecutor(max_workers=1)
154+
self.interrupter = threading.Thread(None, self._wait_interruption)
155155
self._setup = True
156156

157157
def run(self, experiment: Experiment, probes: List[Probe],
@@ -164,7 +164,8 @@ def run(self, experiment: Experiment, probes: List[Probe],
164164
or not), then this call blocks until all these pre-check safeguards
165165
are completed.
166166
"""
167-
self.interrupter.submit(self._wait_interruption)
167+
self.interrupter.start()
168+
168169
for p in probes:
169170
f = None
170171
if p.get("frequency"):

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
setup(
66
use_scm_version=True,
77
name="chaostoolkit-addons",
8-
version="0.8.0",
8+
version="0.8.1",
99
)

0 commit comments

Comments
 (0)