Skip to content

Commit

Permalink
Prevent infinite loop. (#922)
Browse files Browse the repository at this point in the history
  • Loading branch information
felixfontein authored Jul 7, 2024
1 parent 7ec56d3 commit 6fcbd34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/922-docker_container-wait-fix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- "docker_container - fix possible infinite loop if ``removal_wait_timeout`` is set (https://github.com/ansible-collections/community.docker/pull/922)."
2 changes: 1 addition & 1 deletion plugins/module_utils/module_container/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def wait_for_state(self, container_id, complete_states=None, wait_states=None, a
self.fail(msg.format(container_id, state))
# Wait
if max_wait is not None:
if total_wait > max_wait:
if total_wait > max_wait or delay < 1E-4:
msg = 'Timeout of {1} seconds exceeded while waiting for container "{0}"'
self.fail(msg.format(container_id, max_wait))
if total_wait + delay > max_wait:
Expand Down

0 comments on commit 6fcbd34

Please sign in to comment.