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

Service gets stuck when calling "docker service update" and won't progress #97

Closed
fooflington opened this issue Feb 24, 2023 · 2 comments · Fixed by #98
Closed

Service gets stuck when calling "docker service update" and won't progress #97

fooflington opened this issue Feb 24, 2023 · 2 comments · Fixed by #98
Labels
Milestone

Comments

@fooflington
Copy link
Contributor

fooflington commented Feb 24, 2023

It appears that the service is getting stuck sometimes when asking docker to docker service update… on one cluster it's been stuck for over 24 hours…

$ docker exec -ti 97926cd69f86 ash
/ # ps -ef
PID   USER     TIME  COMMAND
    1 root      0:00 {shepherd} /bin/bash /usr/local/bin/shepherd
  301 root      6:35 docker service update x --detach=false --with-registry-auth --image=x
  315 root      0:00 ash
  321 root      0:00 ps -ef

If I kill pid=301 then it unblocks and continues on.

Consider calling docker service update via timeout to catch this?

https://github.com/djmaze/shepherd/blob/master/shepherd#L101

if ! timeout ${TIMEOUT_SECONDS:-300} docker "${config_flag[@]}" service update "$name" $detach_option $registry_auth $no_resolve_image_flag ${UPDATE_OPTIONS} --image="$image" > /dev/null
# timeout --help
BusyBox v1.34.1 (2021-11-23 00:57:35 UTC) multi-call binary.

Usage: timeout [-s SIG] SECS PROG ARGS

Run PROG. Send SIG to it if it is not gone in SECS seconds.
Default SIG: TERM.
@fooflington
Copy link
Contributor Author

The underlying "hang" appears to be related to docker/cli#627 (the service being updated is at replicas=0 in my case because it's a "cronjob" managed by crazymax/swarm-cronjob)

@djmaze djmaze added this to the 0.7.1 milestone Feb 26, 2023
@shizunge

This comment was marked as spam.

moschlar added a commit that referenced this issue Oct 30, 2023
[Full Changelog](0.7.0...1.8.0)

**Breaking changes:**

- The docker image registry location has been changed to the containrrr organisation:
  `containrrr/shepherd`

**Implemented enhancements:**

- armhf support [\#108](#108)
- Switch to official docker image v24 [\#107](#107) ([djmaze](https://github.com/djmaze))
- Restrict runtime of "docker service update" using "timeout" [\#98](#98) ([fooflington](https://github.com/fooflington))
- Add example for usage with swarm-cronjob [\#89](#89) ([djmaze](https://github.com/djmaze))

**Fixed bugs:**

- Can't update some services: no such manifest [\#105](#105)
- Service gets stuck when calling "docker service update" and won't progress [\#97](#97)
- fix: docker service update with `--detach=false` hangs on services wi… [\#104](#104) ([AliRezaBeitari](https://github.com/AliRezaBeitari))
- Fix defunc VERBOSE handling [\#91](#91) ([sebthom](https://github.com/sebthom))

**Closed issues:**

- How does it determine if there is an update or not? [\#111](#111)
- Looking for a new maintainer [\#96](#96)
- New OCI manifest issue [\#92](#92)
- Run service update at a fixed time [\#88](#88)
- docker swarm 20.10.12 | "docker service update" requires exactly 1 argument. [\#83](#83)
- Error updating service, does not exist or it is not available when using a duplicate registry [\#78](#78)

**Merged pull requests:**

- Add apprise type and additional error notification [\#118](#118) ([andyloree](https://github.com/andyloree))
- Rename image in docs [\#114](#114) ([moschlar](https://github.com/moschlar))
- Fix release workflow [\#113](#113) ([moschlar](https://github.com/moschlar))
- Update README.md [\#103](#103) ([andrew-dixon](https://github.com/andrew-dixon))
- ci: add basic github actions for build/release [\#101](#101) ([piksel](https://github.com/piksel))
- correct misleading description of WITH\_NO\_RESOLVE\_IMAGE [\#100](#100) ([alex-vg](https://github.com/alex-vg))
- Move example configs to their own folder [\#99](#99) ([djmaze](https://github.com/djmaze))
- Add documentation about `REGISTRIES_FILE` [\#94](#94) ([tito](https://github.com/tito))
- Minor refactoring [\#90](#90) ([sebthom](https://github.com/sebthom))

Closes: #117
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants