Skip to content

Deadline can fire before stream started #1343

@ejona86

Description

@ejona86

In ClientCallImpl the deadline is scheduled before stream.start(). However, if the deadline has already elapsed the runnable will be executed immediately and race with the start. I've only looked into how OkHttp may be impacted.

I believe a NullPointerException would be thrown when trying to notify the stream listener due to the cancellation. However, due to #1237 the exception won't be logged. Thus, this will result in a hung stream that never completes with no logging as to what went wrong.

This was discovered due to timeout_on_sleeping_server on android being flaky, because it uses a very small timeout. The test would fail at awaitCompletion.

@carl-mastrangelo, FYI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions