Skip to content

Conversation

@vrothberg
Copy link
Member

Fallback to executing ps(1) in case we hit an unknown psgo descriptor.
This ensures backwards compatibility with docker-top, which was purely
ps(1) driven.

Also support comma-separated descriptors as input.

Signed-off-by: Valentin Rothberg rothberg@redhat.com

@openshift-ci-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vrothberg

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L labels Apr 29, 2019
@TomSweeneyRedHat
Copy link
Member

ping back to @vrotherber's radar

@vrothberg
Copy link
Member Author

Thanks a lot, @TomSweeneyRedHat! I didn't notice it was tagged for 1.3.0 (didn't receive an email for that). I will pick this up tomorrow morning :)

@rh-atomic-bot
Copy link
Collaborator

☔ The latest upstream changes (presumably #2985) made this pull request unmergeable. Please resolve the merge conflicts.

Fallback to executing ps(1) in case we hit an unknown psgo descriptor.
This ensures backwards compatibility with docker-top, which was purely
ps(1) driven.

Also support comma-separated descriptors as input.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
@vrothberg
Copy link
Member Author

Updated ✔️ @TomSweeneyRedHat @mheon @rhatdan PTAL

FYI: the logic is now a bit simpler. If we hit psgo.ErrUnknownDescriptor we just go ahead and execute ps(1). If that fails, we return the previous psgo error. HOWEVER: there is some crazy thing going on in the wild as the ps(1) in Busybox and Alpine is totally happy with ps invalid-arg. I suggest that's something we can accept. Otherwise, we'd run into all kinds of weird corner cases.

@rhatdan
Copy link
Member

rhatdan commented May 3, 2019

I thought I read where @mheon suggested that we not document this behaviour? Or was that someone else? Or was I dreaming?

@vrothberg
Copy link
Member Author

@rhatdan, good point! I missed mentioning that I would not do that due to the inconsistent behavior of ps across linux distros, see the following example:

$ ./bin/podman run -d --rm debian sleep 200
57c1c39755641263df3a0aa951891846ac31765a346b3c8c2378a46c3604be95
$ ./bin/podman top -l invalid
Error: 'invalid': unknown descriptor

$ ./bin/podman run -d --rm alpine sleep 200
aeba614cc3802d8c39bcebd3d4025efaac2fbfc8dffe285acf70f52e9bb6003b
$ ./bin/podman top -l invalid
PID   USER     TIME  COMMAND
    1 root      0:00 sleep 200

I removed it from the help message but I vote for keeping it in the man pages. Otherwise, users have to figure out on their own whats going on which might not be the best experience.

@rhatdan
Copy link
Member

rhatdan commented May 3, 2019

OK.
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label May 3, 2019
@openshift-merge-robot openshift-merge-robot merged commit 0eaba2d into containers:master May 3, 2019
@vrothberg vrothberg deleted the top-fallback branch June 23, 2023 13:45
@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

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. 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 this pull request may close these issues.

7 participants