Prevent infinite loop. (#922)

This commit is contained in:
Felix Fontein 2024-07-07 23:18:58 +02:00 committed by GitHub
parent 7ec56d33cb
commit 6fcbd34e23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -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)."

View File

@ -247,7 +247,7 @@ class ContainerManager(DockerBaseClass):
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: