Skip to content

Fix stoping compose process for single container for file change on sync-restart action - #12014

Merged
glours merged 1 commit into
docker:mainfrom
jhrotko:watch-synch-restart-fix
Jul 25, 2024
Merged

Fix stoping compose process for single container for file change on sync-restart action#12014
glours merged 1 commit into
docker:mainfrom
jhrotko:watch-synch-restart-fix

Conversation

@jhrotko

@jhrotkojhrotko commented Jul 24, 2024

Copy link
Copy Markdown
Contributor

What I did
For a single container project, when changing a file inside a sync+restart target, the container lifecycle is: stop -> die -> start -> restart. However, for an watched attached single container, when there are no more available containers we stop compose execution. Another issue is that we read inpect.State.Restarting the value is false ¯\(ツ)/¯. The proposed fix, evaluates that the restarted container is currently running.

Tried locally the e2e tests for watch and they look like they are stable now, so I enabled them (let's see in the CI)
Related issue

fixes: #11773

(not mandatory) A picture of a cute animal, if possible in relation to what you did
image

@jhrotko
jhrotko requested review from glours and ndeloofJuly 24, 2024 14:13
@jhrotko
jhrotko marked this pull request as ready for review July 24, 2024 14:14
@jhrotkojhrotko changed the title Fix stop on file chane for sync-restart actionFix stoping compose process for single container for file change on sync-restart actionJul 24, 2024
Signed-off-by: Joana Hrotko <joana.hrotko@docker.com>
@jhrotko
jhrotkoforce-pushed the watch-synch-restart-fix branch from 5dddf5d to 591f19dCompareJuly 24, 2024 14:16
@jhrotkojhrotko self-assigned this Jul 24, 2024
@glours
glours merged commit ea4ccf6 into docker:mainJul 25, 2024
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Aug 20, 2024
This MR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [docker/compose](https://github.com/docker/compose) | patch | `v2.29.1` -> `v2.29.2` |
MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).
**Proposed changes to behavior should be submitted there as MRs.**
---
### Release Notes
<details>
<summary>docker/compose (docker/compose)</summary>
### [`v2.29.2`](https://github.com/docker/compose/releases/tag/v2.29.2)
[Compare Source](docker/compose@v2.29.1...v2.29.2)
#### What's Changed
##### ✨ Improvements
- docs: Update docker compose kill usage [(12041)](docker/compose#12041)
- add `x-initSync` to watch to always provide initial [(12047)](docker/compose#12047)
##### 🐛 Fixes
- Removes redundant condition from toAPIBuildOptions in build.go [(12009)](docker/compose#12009)
- Fix stoping compose process for single container for file change on sync-restart action [(12014)](docker/compose#12014)
##### 🔧 Internal
- bump golang `1.21.12` [(12017)](docker/compose#12017)
- bump engine and cli to `v27.1.1`, buildx to `v0.16.1` [(12020)](docker/compose#12020)
- bump engine and cli to `v27.1.2`, buildx to `v0.16.2` [(12057)](docker/compose#12057)
- remove all dependabot update MRs for OTel dependencies [(12006)](docker/compose#12006)
- bump golang.org/x/sys `v0.22.0` and gofrs/flock `v0.12.1` [(12018)](docker/compose#12018)
#### New Contributors
- [@&#8203;janbrasna](https://github.com/janbrasna) made their first contribution in [(12041)](docker/compose#12041)
- [@&#8203;kapurm17](https://github.com/kapurm17) made their first contribution in [(12009)](docker/compose#12009)
**Full Changelog**: docker/compose@v2.29.1...v2.29.2
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.
♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this MR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box
---
This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for freeto 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.

[BUG] docker compose up --watch with sync+restart does not show logs after restart

3 participants

@jhrotko@ndeloof@glours