-
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
CI: make 090-events parallel-safe #23987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some tests cannot
be run in parallel due to #23750 ("--events-backend=file"
does not actually mean "events-backend=file").
Well I think this is just misleading, --events-backend=file works fine like this. What happens is that another process not configured to use the file logger can also see your contianer and sync the state there which then creates the died event. The event logger is per process and NOT per container as such this seem totally fine to me.
In general it is not really sane to mix the event loggers like this anyway and no user should do that.
# Wait for container to truly be gone. | ||
# 99% of the time this will return immediately with a "no such container" error, | ||
# which is fine. Under heavy load, it might actually catch the container while | ||
# it's being cleaned up. Either way, this guarantees the "died" event is logged. | ||
PODMAN_TIMEOUT=4 run_podman '?' wait $id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this you could just rmeove the -d
from podman run as the if podman run runs in the foreground it will ensure to delete the container before exit. I guess then we need another way to fetch the cid so I guess in terms of podman command nothing changed so the wait here is fine for me.
That's an internal distinction that makes sense to you, but as you admitted in the bug page it violates POLA for everyone else.
This is something that's very hard for me to understand, even with your explanations. I'm sure in six months I will forget it, and run podman with |
test/system/090-events.bats
Outdated
run_podman run --name=$cname --rm $IMAGE true | ||
# FIXME FIXME FIXME, please confirm that my 'container=' change is correct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eyeballs requested on this change, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what the indentation was but yes this seems correct status=$cname clearly makes no sense
Do not merge until my FIXME question is answered |
Let me put it another way if you do And --event-backend is a global option not an option when creating a container so it applies only to the current libpod runtime. It really is no different like --db-backend, --network-backend and other which should just not be mixed without knowing the consequences. And yes I realize that in your parallel tests it is a bit more complicated because you do not interact with the container directly from another test but rather just a operation that runs on all container such as podman mount causes the died event to be generated. The reason for this is that the died event should be created as soon as we notice the exit and this means each command that acts on this container and syncs the state can and will cause this event. So if you want to run this in parallel you cannot have other podman process in parallel that act on all containers and of course this is much more difficult then not using --event-backend in parallel
you can use it, but it must be consistently for all commands like we do in e2e. Not only for some. |
...or at least as much as possible. Some tests cannot be run in parallel due to containers#23750: "--events-backend=file" does not actually work the way a naïve user would intuit. Stop/die events are asynchronous, and can be gathered by *ANY OTHER* podman process running after it, and if that process has the default events-backend=journal, that's where the event will be logged. See containers#23987 for further discussion. Signed-off-by: Ed Santiago <[email protected]>
655ee3e
to
5468718
Compare
Thank you, that is a good illustration that helps me understand. However... I think we're in a middle situation because there is no podman operation on
Is that a sensible explanation of what is happening? Anyhow, I updated the commit message, is that more acceptable? |
Yes
sounds good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: edsantiago, Luap99 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
...or at least as much as possible. Some tests cannot
be run in parallel due to #23750: "--events-backend=file"
does not actually work the way a naïve user would intuit.
Stop/die events are asynchronous, and can be gathered
by ANY OTHER podman process running after it, and if
that process has the default events-backend=journal,
that's where the event will be logged. See #23987 for
further discussion.
Signed-off-by: Ed Santiago [email protected]