Skip to content

Commit

Permalink
Merge pull request containerd#5 from abel-von/kuasario
Browse files Browse the repository at this point in the history
fix two issues of sandbox
  • Loading branch information
Burning1020 authored Jan 16, 2024
2 parents 6081f89 + 6be323b commit d225348
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion runtime/v2/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ func (m *ShimManager) Start(ctx context.Context, id string, opts runtime.CreateO
return nil, err
}

shim, err := loadShim(ctx, bundle, func() {})
shim, err := loadShim(ctx, bundle, func() {
if err := bundle.Delete(); err != nil {
log.G(ctx).Errorf("failed to delete bundle %w", err)
}
m.shims.Delete(ctx, id)
})
if err != nil {
return nil, fmt.Errorf("failed to load sandbox task %q: %w", opts.TaskAddress, err)
}
Expand Down
13 changes: 13 additions & 0 deletions services/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,18 @@ func (pc *proxyClients) getClient(address string) (*grpc.ClientConn, error) {
connParams := grpc.ConnectParams{
Backoff: backoffConfig,
}
retryPolicy := `{
"methodConfig": [{
"name": [{"service": "containerd.services.sandbox.v1.Controller", "method": "Wait"}],
"waitForReady": true,
"retryPolicy": {
"MaxAttempts": 10000,
"InitialBackoff": ".1s",
"MaxBackoff": "10s",
"BackoffMultiplier": 2.0,
"RetryableStatusCodes": [ "UNAVAILABLE" ]
}
}]}`
gopts := []grpc.DialOption{
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithConnectParams(connParams),
Expand All @@ -476,6 +488,7 @@ func (pc *proxyClients) getClient(address string) (*grpc.ClientConn, error) {
// TODO(stevvooe): We may need to allow configuration of this on the client.
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(defaults.DefaultMaxRecvMsgSize)),
grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(defaults.DefaultMaxSendMsgSize)),
grpc.WithDefaultServiceConfig(retryPolicy),
}

conn, err := grpc.Dial(dialer.DialAddress(address), gopts...)
Expand Down

0 comments on commit d225348

Please sign in to comment.