mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-27 04:41:26 -07:00
iptables_state: fix race condition between module and its action plugin (#1140)
* fix race condition between module and its action plugin See https://github.com/ansible-collections/community.general/issues/1136. Also remove irrelevant/unneeded display.v() and display.warning() around connection reset. * do not check for cookie if not in async mode * add changelog fragment
This commit is contained in:
parent
18a5330e62
commit
3bc31f286e
3 changed files with 30 additions and 5 deletions
|
@ -551,6 +551,18 @@ def main():
|
|||
restored_state = state_to_restore
|
||||
|
||||
else:
|
||||
# Let time enough to the plugin to retrieve async status of the module
|
||||
# in case of bad option type/value and the like.
|
||||
if _back is not None:
|
||||
b_starter = to_bytes('%s.starter' % _back, errors='surrogate_or_strict')
|
||||
while True:
|
||||
if os.path.exists(b_starter):
|
||||
os.remove(b_starter)
|
||||
break
|
||||
else:
|
||||
time.sleep(0.01)
|
||||
continue
|
||||
|
||||
(rc, stdout, stderr) = module.run_command(MAINCOMMAND)
|
||||
if 'Another app is currently holding the xtables lock' in stderr:
|
||||
module.fail_json(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue