Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

jhrotko
Copy link
Contributor

@jhrotko jhrotko commented Jul 24, 2024

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 ndeloof and glours July 24, 2024 14:13
@jhrotko jhrotko marked this pull request as ready for review July 24, 2024 14:14
@jhrotko jhrotko changed the title Fix stop on file chane for sync-restart action Fix stoping compose process for single container for file change on sync-restart action Jul 24, 2024
@jhrotko jhrotko force-pushed the watch-synch-restart-fix branch from 5dddf5d to 591f19d Compare July 24, 2024 14:16
@jhrotko jhrotko self-assigned this Jul 24, 2024
@glours glours merged commit ea4ccf6 into docker:main Jul 25, 2024
30 checks passed
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 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.

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