Skip to content

How does deadline work? #1495

@pszemus

Description

@pszemus

I'm creating a blocking stub with deadline:

blockingStub = MyGrpc
        .newBlockingStub(channel)
        .withDeadlineAfter(3, TimeUnit.SECONDS);

and then I start calling method in a loop:

for (int i=0; i<100; i++) blockingStub.doSomething();

first 8 calls are handled correctly but others end with DEADLINE_EXCEEDED exception.
Looking at my gRPC server logs I can see that the 8th call (last succeeded call) is ~3 seconds after the 1st one, so I assume that the deadline I set is for all my calls.
How to set up a deadline per call ?

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