Reap still running threads after timeout

This is an improvement to #49921 which reaps threads after the timeout
expires instead of letting them continue to take up resources.
pull/70347/head
Toshio Kuratomi 6 years ago
parent d6fb42d1c5
commit ca90c138f4

@ -50,6 +50,8 @@ def timeout(seconds=None, error_message="Timer expired"):
except multiprocessing.TimeoutError: except multiprocessing.TimeoutError:
# This is an ansible.module_utils.common.facts.timeout.TimeoutError # This is an ansible.module_utils.common.facts.timeout.TimeoutError
raise TimeoutError('Timer expired after %s seconds' % timeout_value) raise TimeoutError('Timer expired after %s seconds' % timeout_value)
finally:
pool.terminate()
return wrapper return wrapper

Loading…
Cancel
Save