Skip to content

binder: client doesn't tell the server about errors during the handshake #12438

@jdcormie

Description

@jdcormie

BinderClientTransport may call shutdownInternal to report many types of errors during the connection handshake, for example:

  • "Wire format version mismatch"
  • "Malformed SETUP_TRANSPORT data"
  • SecurityPolicy failed to evaluate or returned permission denied
  • connect timeout
  • and other errors, if shutdownNow() is called externally

But BinderClientTransport's handshake sequence doesn't call setOutgoingBinder() until the very end. This means that calls to shutdownInternal() -> sendShutdownTransaction() return without sending anything because outgoingBinder == null.

Maybe this was intentional but I can't think of why. It does mean that the peer's BinderServerTransport object and resources are tied up until the handshake timeout elapses (default 120s). Better IMHO would be to call setOutgoingBinder() right away so that the server can promptly give up on the connection too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions