Commit 06aad49b authored by Wout De Nolf's avatar Wout De Nolf
Browse files

Scan: potential greenlet leak for watchdog

parent 7261095d
Pipeline #51799 passed with stages
in 108 minutes and 47 seconds
......@@ -1675,6 +1675,9 @@ class Scan:
ctx = self._runctx_watchdog(capture)
add_context(ctx)
ctx = self._runctx_watchdog_callback(capture)
add_context(ctx)
# NB: "user_print" messages won't be displayed to stdout, this avoids
# output like "moving from X to Y" on motors for example. In principle
# there should be no output to stdout from the scan itself.
......@@ -1802,12 +1805,19 @@ class Scan:
@contextmanager
def _runctx_watchdog(self, capture):
self._watchdog_task.start()
self._watchdog_task.on_scan_new(self, self.scan_info)
try:
yield
finally:
with capture():
self._watchdog_task.kill()
@contextmanager
def _runctx_watchdog_callback(self, capture):
self._watchdog_task.on_scan_new(self, self.scan_info)
try:
yield
finally:
with capture():
self._watchdog_task.on_scan_end(self.scan_info)
@contextmanager
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment