-
Notifications
You must be signed in to change notification settings - Fork 2.6k
APIv2: Events streaming behaves weirdly with socket activation #5599
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
och, so after some fun debugging I found reproducer that does not need cockpit in any way.
See that the last command won't stay around and dies in 5 seconds. If you comment out the first or the middle command, it stays around forever and when you do some podman action it will log events. I was only able to reproduce it that one command finished, then another started and before it finishes we start to listen on events. (Thats why the middle command is run in background so I can start to listen on events before it lists all images - it is great if you have a few images locally so it is not too fast:) ) |
@jwhonce were you able to reproduce this or find any problem that could cause this behaviour? |
@marusak I was able to reproduce the issue with your snippet. I'm debugging issue now. This is one of those infamous "That should never happen issues." The debugging output shows the server exiting with a live connection. I'll be sure and tag this issue in the PR with the fix. |
* Move connection tracking into APIServer using ConnState() * Remove Connection counters from CLI code * Update events handler to support client not closing connection * Improve logging messages Fixes containers#5599 Signed-off-by: Jhon Honce <jhonce@redhat.com>
* Move connection tracking into APIServer using ConnState() * Remove Connection counters from CLI code * Update events handler to support client not closing connection * Improve logging messages Fixes containers#5599 Signed-off-by: Jhon Honce <jhonce@redhat.com>
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
This is collection of observations. I want to point out some finding. Also it does not work greatly with cockpit http client and I am not sure yet if this is problem on cockpit or podman side. I hope that we actually may figure out what is happening and see, what side needs fixing.
I am using current master build. Related #5158
podman.socket
(systemctl enable --now podman.socket
)podman.service
isinactive (dead)
(this is of course expected and correct)sudo curl --unix-socket /run/podman/podman.sock http://d/v1.24/events
podman.service
isactivating (start)
. ((1) Neverrunning
though - this is one interesting observation)podman run fedora
and there are 6 events (fromcreate
tocleanup
)) That is all correct.podman.service
never dies (2). It stays inactivating (start)
forever. (Well, at least for around 10minutes, not sure how this works, maybe there is some exponential backof?). I would guess that when no one is listening, the service should die.Now, when I try to do the same with cockpit http client. (3)
Points 1. and 2. are the same. I create a new connection to
/run/podman/podman.sock
and call/events
endpoint and attach streaming callback. It works for 5 seconds, and then it disconnects. It does not recognize that there is open connection. Looking intosystemctl status podman
I see it is inactivating (start)
for those 5 seconds and then goes back toinactive (dead)
. Streaming with Cockpit works fine when thepodman system service
does not die (started with-t 0
).I am not sure if this is problem in cockpit http client and in podman not recognizing connection.
If it does not ring any bells (mostly to @jwhonce), than I try to create some simple reproducer with Cockpit. Or if there is some way how I can provide some logs, please let me know.
EDIT: A few more info, how cockpit actually works:
{"method":"GET","path":"/v1.12/events?","superuser":true,"payload":"http-stream2","unix":"/run/podman/podman.sock"}
. http-stream2 documentation.The text was updated successfully, but these errors were encountered: