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

Why does the Events parameter until need to be a negative value if a duration is used? #11158

Closed
arctic-alpaca opened this issue Aug 7, 2021 · 8 comments · Fixed by #11218
Closed
Assignees
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

@arctic-alpaca
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

When using the podman CLI or API, the until parameter for the events command/endpoint can be a timestamp or a duration according to the documentation. When a positive value like 10s is used for the duration, podman returns immediately, even thought it is used in streaming mode. This seems to be caused by this and this line, which subtracts the duration from the current time and uses it as until timestamp. This isn't documented or intuitive.

Steps to reproduce the issue:

  1. ./podman events --since 3m --until 5s returns immediately

  2. ./podman events --since 3m --until -5s takes 5 seconds to return

Describe the results you received:
See previous point.

Describe the results you expected:
Documentation to use a negative value in until or the possibility to use a positive value.

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/master/troubleshooting.md)

The linked code line is in the current master.

@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Aug 7, 2021
@rhatdan
Copy link
Member

rhatdan commented Aug 8, 2021

Interested in opening a PR to fix?

@cdoern PTAL

@arctic-alpaca
Copy link
Contributor Author

I am not familiar with Go and don't feel comfortable opening a PR.

@cdoern
Copy link
Contributor

cdoern commented Aug 9, 2021

I will look at this today, the way podman has handled --until has been flaky in most scenarios until recently.

@cdoern cdoern self-assigned this Aug 9, 2021
@cdoern
Copy link
Contributor

cdoern commented Aug 9, 2021

@arctic-alpaca the lines podman events --since 3m --until 5s and podman events --since 3m --until -5s produce the same output for me, what version are you running on and is there anything else you are doing that could affect the output?

@arctic-alpaca
Copy link
Contributor Author

@cdoern By output, do you mean they both "wait" 5 seconds for new events and then return?
The version should be at least 3.1 but I am currently away from my computer and won't be able to check for a week, sorry.
I'll let you know as soon as I'm back.

@cdoern
Copy link
Contributor

cdoern commented Aug 9, 2021

on my main branch (synced with master) and on the current version of podman, both of these commands sit for 5 seconds and then output the requested data @arctic-alpaca

@Luap99
Copy link
Member

Luap99 commented Aug 10, 2021

@cdoern Can you try with a higher value for until. It could be that podman takes that long to read all your events.

I see this:

$ time bin/podman events --since 0s --until 5s

real    0m1.945s
user    0m2.437s
sys     0m0.453s
$ time bin/podman events --since 0s --until -5s

real    0m5.549s
user    0m2.446s
sys     0m0.419s
$ time bin/podman events --since 0s --until 10s

real    0m1.939s
user    0m2.437s
sys     0m0.436s
$ time bin/podman events --since 0s --until -10s

real    0m10.463s
user    0m2.523s
sys     0m0.433s

@cdoern
Copy link
Contributor

cdoern commented Aug 12, 2021

thanks @Luap99, that will help me figure this out. I will get on it today

cdoern added a commit to cdoern/podman that referenced this issue Aug 23, 2021
we were adding a negative duration in podman events, causing inputs like
-5s to be correct and 5s to be incorrect.

fixes containers#11158

Signed-off-by: cdoern <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 30, 2021
we were adding a negative duration in podman events, causing inputs like
-5s to be correct and 5s to be incorrect.

fixes containers#11158

Signed-off-by: cdoern <[email protected]>
mheon pushed a commit that referenced this issue Aug 30, 2021
we were adding a negative duration in podman events, causing inputs like
-5s to be correct and 5s to be incorrect.

fixes #11158

Signed-off-by: cdoern <[email protected]>
@github-actions 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 21, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 21, 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.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants