Description
According to multiple comments, the CONTAINER_WAIT pipe should be closed by the binary logging driver to signal the shim that the driver is ready. However, in the current implementation, this pipe is always closed by containerd-shim. As a result, even if the binary logging driver fails to initialize and exits abnormally, the container is still started normally.
Expected:
|
// LoggerFunc is implemented by custom v2 logging binaries. |
|
// |
|
// ready should be called when the logging binary finishes its setup and the container can be started. |
|
// |
|
// An example implementation of LoggerFunc: https://github.com/containerd/containerd/tree/main/runtime/v2#logging |
|
type LoggerFunc func(ctx context.Context, cfg *Config, ready func() error) error |
|
// signal that we are ready and setup for the container to be started |
|
if err := ready(); err != nil { |
|
return err |
|
} |
Received:
|
// close our side of the pipe after start |
|
if err := w.Close(); err != nil { |
|
return nil, fmt.Errorf("failed to close write pipe after start: %w", err) |
|
} |
Steps to reproduce the issue
No response
Describe the results you received and expected
Expected: Don't start container when binary logging driver not ready.
Received: Container started normally when binary logging driver not ready.
What version of containerd are you using?
containerd containerd.io 1.6.32 8b3b7ca
Any other relevant information
No response
Show configuration if it is related to CRI plugin.
No response
Description
According to multiple comments, the
CONTAINER_WAITpipe should be closed by the binary logging driver to signal the shim that the driver is ready. However, in the current implementation, this pipe is always closed by containerd-shim. As a result, even if the binary logging driver fails to initialize and exits abnormally, the container is still started normally.Expected:
containerd/core/runtime/v2/logging/logging.go
Lines 32 to 37 in dbc74db
containerd/core/runtime/v2/README.md
Lines 503 to 506 in 58bd48e
Received:
containerd/cmd/containerd-shim-runc-v2/process/io.go
Lines 302 to 305 in 33ee060
Steps to reproduce the issue
No response
Describe the results you received and expected
Expected: Don't start container when binary logging driver not ready.
Received: Container started normally when binary logging driver not ready.
What version of containerd are you using?
containerd containerd.io 1.6.32 8b3b7ca
Any other relevant information
No response
Show configuration if it is related to CRI plugin.
No response