-
Notifications
You must be signed in to change notification settings - Fork 347
Conversation
a37bddd to
499b691
Compare
9f57c33 to
4facac4
Compare
mikebrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
pkg/metadata/container.go
Outdated
| @@ -73,6 +74,11 @@ type ContainerMetadata struct { | |||
| // into the store directly. | |||
| // TODO(random-liu): Reset this field to false during state recoverry. | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/s/recoverry/recovery/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| // TODO(random-liu): Remove following fields after switching to new containerd | ||
| // client. | ||
| // Not including them in unit test now because they will be removed soon. | ||
| // Spec is the oci runtime spec used to run the container. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fields, them, they.. but only Spec is there...was this supposed to cover more fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially there are more. Will change to field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkg/server/container_execsync.go
Outdated
| if err != nil { | ||
| return nil, fmt.Errorf("an error occurred when try to find container %q: %v", r.GetContainerId(), err) | ||
| } | ||
| id := r.GetContainerId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this assignment up and use id as param to .Get()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, will do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to id := meta.ID.
The metadata store may support truncated index soon, so get the id from metadata.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
| } | ||
| exitCode, err := waitContainerExec(cancel, events, id, resp.Pid, r.GetTimeout()) | ||
| if err != nil { | ||
| return nil, fmt.Errorf("failed to wait for exec in container %q to finish: %v", id, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this return eats the unknownExitCode.. What's that for if we are going to nil it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! We do have some special logic here in dockershim. Let me check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If containerd dies during waiting, the exec process may still be running, so I think we should return error instead of 255 exit code without error.
I still keep the unknownExitCode, because:
- We may still need it when adding the recovery logic after daemon restart.
- Just in case we use the 0 exit code by mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.. will watch for the recovery logic code to see unknownExitCode in action then :-)
4facac4 to
ae0252c
Compare
Signed-off-by: Lantao Liu <[email protected]>
ae0252c to
9b79201
Compare
mikebrow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add ExecSync.
Re-implement "No HTTP2" support using "GODEBUG=http2client=0"
Add simple
ExecSyncbased on current containerd api.Some TODOs in the future which will be addressed in future PRs:
ExecSynctimeout support, including timeout waiting and graceful termination after timeout.Signed-off-by: Lantao Liu [email protected]