-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
poststop hook executed twice #9983
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Comments
openshift-ci-robot
added
the
kind/bug
Categorizes issue or PR as related to a bug.
label
Apr 9, 2021
If you run this command without the --rm flag, does the same issue happen? |
rhatdan
added a commit
to rhatdan/podman
that referenced
this issue
Apr 12, 2021
10 lines above we had // Set ContainerStateRemoving c.state.State = define.ContainerStateRemoving Which causes the state to not be the two checked states. Since the c.cleanup call already deleted the OCI state, this meant that we were calling cleanup, and hence the postHook hook twice. Fixes: containers#9983 [NO TESTS NEEDED] Since it would be difficult to tests this. Main tests should handle that the container is being deleted successfully. Signed-off-by: Daniel J Walsh <[email protected]>
# podman --log-level=debug --hooks-dir="/etc/containers/oci/hooks.d/" run --annotation=testhook=true -it docker.io/library/bash
bash-5.1# ls
bin dev etc home lib media mnt opt proc root run sbin srv sys tmp usr var
bash-5.1#
exit
# cat prestart-hook.log
----Prestart
1618285896
# cat poststop-hook.log
----Poststop
1618285903
# podman ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
6b57d57fb225 docker.io/library/bash bash 27 seconds ago Exited (0) 19 seconds ago elegant_goldwasser
# podman rm 6b57d57fb225
6b57d57fb2258df8cff56b1213d85c79eff8a4b8a9b04d17df213e9f588dcf49
# cat poststop-hook.log
----Poststop
1618285903
----Poststop
1618285931
|
mheon
pushed a commit
to mheon/libpod
that referenced
this issue
Apr 16, 2021
10 lines above we had // Set ContainerStateRemoving c.state.State = define.ContainerStateRemoving Which causes the state to not be the two checked states. Since the c.cleanup call already deleted the OCI state, this meant that we were calling cleanup, and hence the postHook hook twice. Fixes: containers#9983 [NO TESTS NEEDED] Since it would be difficult to tests this. Main tests should handle that the container is being deleted successfully. Signed-off-by: Daniel J Walsh <[email protected]>
jmguzik
pushed a commit
to jmguzik/podman
that referenced
this issue
Apr 26, 2021
10 lines above we had // Set ContainerStateRemoving c.state.State = define.ContainerStateRemoving Which causes the state to not be the two checked states. Since the c.cleanup call already deleted the OCI state, this meant that we were calling cleanup, and hence the postHook hook twice. Fixes: containers#9983 [NO TESTS NEEDED] Since it would be difficult to tests this. Main tests should handle that the container is being deleted successfully. Signed-off-by: Daniel J Walsh <[email protected]>
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Sep 22, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
/kind bug
Description
Consider the following hooks example for podman
prestart-hook.json
andpoststop-hook.json
prestart-hook.sh
andpoststop-hook.sh
are executed in prestart and poststop stages respectively. Writes logs toprestart-hook.log
andpoststop-hook.log
--rm
optionprestart-hook.log
andpoststop-hook.log
, we can notice that the poststop hook has been executed twice.--log-level=debug
. We can see debug logs where poststop hook is executed twice for a single container launch and exit.Issue
prestart
andpoststop
only. But poststop executed twice.--rm
option the poststop hook executes only once, but whenpodman rm <ID>
is run the poststop hook executes again.How to?
Understood from the source the following
Output of
podman version
:The text was updated successfully, but these errors were encountered: