Skip to content

[BUG] Requests with Grpc Reactive Client are completed at the end of the flow #222

Open
@jorgerod

Description

@jorgerod

Describe the Bug

Requests with Reactive Grpc Client (integration with reactor) are completed at the end of the flow and not when the response to that request is obtained.

This treatment causes the incorrect behaviour of the instrumentation with other components (metrics or traces).

 grpcClient.findById(productId, storeId) //<1>
                .map(product -> {    //<2>
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    return product.getName();
                })

In this example, as the call to the onComplete function is made to the end of flow.
Brave tracing instrumentation or metrics instrumentation are incorrect because the grpc request time is the sum of the grpc client operation <1> plus the map operation <2>

zipkin

Expected Behaviour

Method OnComplete should be called when the grpcClient request ends and not when the flow ends.

How do you see it?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions