Skip to content

The binary logging driver does not function as intended. #12490

@zwtop

Description

@zwtop

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions