Skip to content

Commit

Permalink
Do not remove temporal containers automatically
Browse files Browse the repository at this point in the history
Temporal containers can finish faster than the startup probe can check.
The check interval comes from the docker client with rate limiting which
queries the docker service at most once per second. This can create a
race condition if the container can complete it's job in less or around
1 second.
  • Loading branch information
lukasz-walkiewicz authored and kokosing committed Jan 24, 2022
1 parent 55ea750 commit 51cf040
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,9 @@ public Builder addContainer(DockerContainer container)

container.withCreateContainerCmdModifier(Builder::updateContainerHostConfig);

if (!container.getLogicalName().equals(TESTS)) {
// Tests container cannot be auto removed as we need to inspect it's exit code
if (!container.getLogicalName().equals(TESTS) && !container.isTemporary()) {
// Tests container cannot be auto removed as we need to inspect it's exit code.
// Temporal containers might exit earlier than the startup check polling interval.
container.withCreateContainerCmdModifier(Builder::setContainerAutoRemove);
}

Expand Down

0 comments on commit 51cf040

Please sign in to comment.