Skip to content

containerz: remove ambiguous error signaling #285

Description

@LimeHat

StartContainer() has an ambiguous definition of error signaling:

  • the description (presumably) talks about returning gRPC errors (which, in my opinion, is the correct approach):
    // This RPC will return the following error codes in case of error:
    // - FailedPrecondition if an invalid value is used for restart policy or
    // RunAs is supplied.
    // - AlreadyExists if the container instance name already exists.
    // - Unavailable if the container tries to expose an already used port.
    // - Internal if internal container operations are failing.
    rpc StartContainer(StartContainerRequest) returns (StartContainerResponse) {}
  • but then StartContainerResponse implements its own error signaling mechanism
    message StartContainerResponse {
    oneof response {
    StartOK start_ok = 1;
    StartError start_error = 2;
    }
    }
    message StartOK {
    // The running containers name.
    string instance_name = 1;
    }
    message StartError {
    enum Code {
    UNSPECIFIED = 0;
    // An unknown error. The details field should provide more information.
    UNKNOWN = 1;
    // The container image was not found.
    NOT_FOUND = 2;
    // Exposed port is already used by another container.
    PORT_USED = 3;
    }
    Code error_code = 1;
    string details = 2;
    }

This creates ambiguity which mechanism should be used. I'd suggest deprecating the latter.

Similar inband error signaling is defined in UpdateContainer RPC, although its description does not mention grpc error codes

message UpdateContainerResponse {
oneof response {
UpdateOK update_ok = 1;
UpdateError update_error = 2;
}
}

IMO gRPC error codes should be used throughout the service definition and all inband error signaling should be deprecated/removed

@robshakir @alshabib

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions