Skip to content

ps: enhance list command with COMMAND/STATUS/CREATED - #1

Merged
AkihiroSuda merged 1 commit into
containerd:masterfrom
fuweid:enhance-ps-command
Dec 5, 2020
Merged

AkihiroSuda merged 1 commit into
containerd:masterfrom
fuweid:enhance-ps-command

Conversation

@fuweid

@fuweid fuweid commented Dec 4, 2020

Copy link
Copy Markdown
Member

Signed-off-by: Wei Fu [email protected]

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! You are really fast 👍

Comment thread ps.go

func containerStatus(ctx context.Context, c containerd.Container) string {
// Just in case, there is something wrong in server.
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be in newClient() in client.go?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the one shim has dead lock issue, the task.Status will get stuck without timeout and ps also get stuck. So I add the magic 5 second here to prevent ps action getting stuck from one dead-lock-shim. WDYT?

Comment thread ps.go Outdated
"", // COMMAND
"", // CREATED
"", // STATUS
containerCommand(spec, true),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should take clicontext.Bool("no-trunc") as the second arg?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@fuweid
fuweid force-pushed the enhance-ps-command branch from 15dfb3c to 0d2d8b1 Compare December 5, 2020 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants