v2: Call shim.Delete at first when create is failed
If the context is cancelled during `shim.Create()`, such as the client disconnects unexpectedly. The created shim will never be deleted. What's more, if the context is cancelled during `openShimLog()`, the fifo will be closed and block the shim output. Signed-off-by: Li Yuxuan <liyuxuan04@baidu.com>
This commit is contained in:
@@ -74,7 +74,7 @@ func (b *binary) Start(ctx context.Context, opts *types.Any, onClose func()) (_
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
f, err := openShimLog(ctx, b.bundle, client.AnonDialer)
|
||||
f, err := openShimLog(context.Background(), b.bundle, client.AnonDialer)
|
||||
if err != nil {
|
||||
return nil, errors.Wrap(err, "open shim log pipe")
|
||||
}
|
||||
|
Reference in New Issue
Block a user