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

[workspacekit] improve logging when not able to connect to daemon #9951

Merged
merged 1 commit into from
May 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions components/workspacekit/cmd/rings.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var ring0Cmd = &cobra.Command{

client, err := connectToInWorkspaceDaemonService(ctx)
if err != nil {
log.WithError(err).Error("cannot connect to daemon")
log.WithError(err).Error("cannot connect to daemon from ring0")
return
}

Expand All @@ -90,7 +90,7 @@ var ring0Cmd = &cobra.Command{

client, err := connectToInWorkspaceDaemonService(ctx)
if err != nil {
log.WithError(err).Error("cannot connect to daemon")
log.WithError(err).Error("cannot connect to daemon from ring0 in defer")
return
}
defer client.Close()
Expand Down Expand Up @@ -204,7 +204,7 @@ var ring1Cmd = &cobra.Command{
if !ring1Opts.MappingEstablished {
client, err := connectToInWorkspaceDaemonService(ctx)
if err != nil {
log.WithError(err).Error("cannot connect to daemon")
log.WithError(err).Error("cannot connect to daemon from ring1 when mappings not established")
return
}
defer client.Close()
Expand Down Expand Up @@ -397,7 +397,7 @@ var ring1Cmd = &cobra.Command{

client, err := connectToInWorkspaceDaemonService(ctx)
if err != nil {
log.WithError(err).Error("cannot connect to daemon")
log.WithError(err).Error("cannot connect to daemon from ring1")
Copy link
Contributor

Choose a reason for hiding this comment

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

Should it be ring2?

Copy link
Contributor

@utam0k utam0k May 12, 2022

Choose a reason for hiding this comment

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

I think it is correct because ring2 starts here as another process from ring1. This code calls itself (i.e., workspacekit) in a separate process. Double-fork is required before the container is created.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for your kindly explanation @utam0k, attach the diagram for future reference
image

return
}
_, err = client.MountProc(ctx, &daemonapi.MountProcRequest{
Expand Down Expand Up @@ -466,7 +466,7 @@ var ring1Cmd = &cobra.Command{

client, err = connectToInWorkspaceDaemonService(ctx)
if err != nil {
log.WithError(err).Error("cannot connect to daemon")
log.WithError(err).Error("cannot connect to daemon from ring1 after ring2")
return
}
_, err = client.SetupPairVeths(ctx, &daemonapi.SetupPairVethsRequest{Pid: int64(cmd.Process.Pid)})
Expand Down