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.
This commit is contained in:
parent
d6fb42d1c5
commit
ca90c138f4
1 changed files with 2 additions and 0 deletions
|
@ -50,6 +50,8 @@ def timeout(seconds=None, error_message="Timer expired"):
|
|||
except multiprocessing.TimeoutError:
|
||||
# This is an ansible.module_utils.common.facts.timeout.TimeoutError
|
||||
raise TimeoutError('Timer expired after %s seconds' % timeout_value)
|
||||
finally:
|
||||
pool.terminate()
|
||||
|
||||
return wrapper
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue