Skip to content

Commit 5f08f58

Browse files
authored
Merge pull request #1018 from plotly/debug-runner
Debug runner
2 parents 5d9f578 + 24bcfa3 commit 5f08f58

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/).
77
- [#967](https://github.com/plotly/dash/pull/967) Adds support for defining
88
clientside JavaScript callbacks via inline strings.
99

10+
### Fixed
11+
- [#1018](https://github.com/plotly/dash/pull/1006) Fix the `dash.testing` **stop** API with process application runner in Python2. Use `kill()` instead of `communicate()` to avoid hanging.
12+
1013
## [1.6.1] - 2019-11-14
1114
### Fixed
1215
- [#1006](https://github.com/plotly/dash/pull/1006) Fix IE11 / ES5 compatibility and validation issues

dash/testing/application_runners.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def __exit__(self, exc_type, exc_val, traceback):
9595
self.stop_timeout
9696
)
9797
)
98+
logger.info("__exit__ complete")
9899

99100
@property
100101
def url(self):
@@ -231,22 +232,25 @@ def start(
231232
def stop(self):
232233
if self.proc:
233234
try:
235+
logger.info("proc.terminate with pid %s", self.proc.pid)
234236
self.proc.terminate()
235237
if utils.PY3:
236238
# pylint:disable=no-member
237239
_except = subprocess.TimeoutExpired
238240
# pylint: disable=unexpected-keyword-arg
239241
self.proc.communicate(timeout=self.stop_timeout)
240242
else:
241-
_except = OSError
242-
self.proc.communicate()
243+
_except = Exception
244+
logger.info('ruthless kill the process to avoid zombie')
245+
self.proc.kill()
243246
except _except:
244247
logger.exception(
245248
"subprocess terminate not success, trying to kill "
246249
"the subprocess in a safe manner"
247250
)
248251
self.proc.kill()
249252
self.proc.communicate()
253+
logger.info('process stop completes!')
250254

251255

252256
class RRunner(ProcessRunner):

0 commit comments

Comments
 (0)