Skip to content

wait "removing" containers#2296

Merged
pablomendezroyo merged 4 commits intodevelopfrom
marc/wait-removing-composeup
Oct 22, 2025
Merged

wait "removing" containers#2296
pablomendezroyo merged 4 commits intodevelopfrom
marc/wait-removing-composeup

Conversation

@Marketen
Copy link
Copy Markdown
Contributor

@Marketen Marketen commented Oct 17, 2025

This pull request introduces improvements to the dockerComposeUpPackage function in dockerComposeUp.ts to enhance reliability and prevent race conditions. The main changes are the addition of an in-process locking mechanism to prevent concurrent docker-compose up calls for the same compose file, and a check to block operations if any container is in a 'removing' state.

Concurrency control and reliability improvements:

  • Added an in-process lock map (composeUpLocks) to prevent concurrent dockerComposeUpPackage executions for the same composePath, ensuring only one operation per compose file runs at a time. [1] [2] [3]
  • Updated the function documentation to reflect the new concurrency prevention feature.

Container state validation:

  • Added a check to prevent dockerComposeUpPackage from running if any service container is in the 'removing' state, improving error handling and preventing potential issues with partially removed containers.

@github-actions github-actions bot temporarily deployed to commit October 17, 2025 14:59 Inactive
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 17, 2025

@github-actions github-actions bot temporarily deployed to commit October 20, 2025 12:02 Inactive
@github-actions github-actions bot temporarily deployed to commit October 20, 2025 12:17 Inactive
@Marketen Marketen marked this pull request as ready for review October 21, 2025 10:04
@Marketen Marketen requested a review from a team as a code owner October 21, 2025 10:04
const removingContainers = dnpData.containers.filter(c => c.state === "removing");
if (removingContainers.length > 0) {
const serviceNames = removingContainers.map(c => c.serviceName).join(", ");
logs.warn(`dockerComposeUpPackage: Cannot proceed, services in 'removing' state: ${serviceNames}`);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would remove warn log since u are already throwing and this error should be logged afterwards

@github-actions github-actions bot temporarily deployed to commit October 22, 2025 07:32 Inactive
@pablomendezroyo pablomendezroyo merged commit 97fa680 into develop Oct 22, 2025
9 checks passed
@pablomendezroyo pablomendezroyo deleted the marc/wait-removing-composeup branch October 22, 2025 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants