containers / podman

Podman: A tool for managing OCI containers and pods.
https://podman.io
Apache License 2.0
22.4k stars 2.31k forks source link

podman events --since="nonsense" is nondeterministic #23165

Closed edsantiago closed 6 hours ago

edsantiago commented 2 days ago

It will sometimes succeed!

$ t0=$SECONDS;i=0;while :;do i=$((i+1));bin/podman events --since="the dawn of time...ish" && break;done;printf "%d seconds, %d tries\n" $((SECONDS-$t0)) $i
...
Error: failed to parse event filters: unable to convert since time of the dawn of time...ish: unable to interpret time value
74 seconds, 3674 tries

And sometimes that will continue looping forever (or five minutes, which is ~equivalent). I have no idea what makes it "succeed". And, given a loop exit, no idea what to do to investigate.

edsantiago commented 2 days ago

A few more failures:

1361 seconds, 67355 tries
...
602 seconds, 29632 tries  (using --since=nonsense)

Still no idea what triggers this.

edsantiago commented 2 days ago

Very weird. I thought the problem might be https://github.com/containers/podman/blob/c279ce0a861c74630e40e5040d599c2836944a99/pkg/util/utils.go#L1112-L1141 returning a false non-error value somehow, so I instrumented it with logrus on every return... and nope, it's actually returning from line 1135, "unable to interpret". I can only conclude that whoever is calling filters.go:generateEventFilters() is not handling the error. And with that I'm outta here for the night.

Luap99 commented 2 days ago

The issue is with how channels and select work I would assume, i.e. see https://github.com/containers/podman/commit/c46884aa93e62bb39fd084433d840db4543b7792

I guess that didn't really fix the main cause as the default: just skips the error if the channel does not yet contain the error.