Skip to content

OkHttp Client stream and transport are tightly coupled #1306

Open
@carl-mastrangelo

Description

@carl-mastrangelo

The interaction between the client stream and transport for OkHttp stream starting is tightly coupled. As brought up in #1294, we should take a look at how these two classes interact and make some clear boundaries (or possibly merge them).

Activity

ejona86

ejona86 commented on Jan 8, 2016

@ejona86
Member

This will probably be partially resolved with the refactoring to make way for cronet support.

added this to the Unscheduled milestone on Jan 8, 2016
ejona86

ejona86 commented on Mar 16, 2016

@ejona86
Member

@carl-mastrangelo, was this improved when I removed the Runnable? If not, it'd be helpful to point out some symptoms of the coupling.

carl-mastrangelo

carl-mastrangelo commented on Mar 16, 2016

@carl-mastrangelo
ContributorAuthor
  • In start, it calls methods on the transport
  • that method can then call back into the stream (with start(1234))
  • the lock used by stream is actually the "lock" of transport
  • transportHeadersReceived is called in by the transport, but must be called under the shared lock.
  • sendCancel calls back into the transport
  • remoteEndClosed does too

There are reasons for all this, but its still pretty coupled. It would be nice if calls only flowed from one to the other. Kun was the original person who brought this up, when I was adding the "start" method.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ejona86@carl-mastrangelo

        Issue actions

          OkHttp Client stream and transport are tightly coupled · Issue #1306 · grpc/grpc-java