Skip to content

LoadBalancedRSocketMono (LatencySubscriber) does not seem to propagate subscriber context properly #822

Closed

Description

@a701440

I am trying to pass additional information in subscriber context through the LoadBalancedRSocketMono to my implementation of RSocket. It seems like LoadBalancedRSocketMono does not properly propagate it up the subscription chain.

After debugging it for a bit it looks like subscriber context is present as expected on the
LatencySubscriber child argument. (child.currentContext() has the data), but then it's lost when subscribing to the source.

LB.getRSocket().flatMap(rsocket -> {
       return rsocket.requestResponse(request).subscriberContext(resultsSink.currentContext());
    })

In this case rsocket is the WeightedRSocket from the LB. I see that resultsSink.currentContext() has correct data, but when the call arrives to the actual RSocket wrapped in the WeightedRSocket in a function like this:

@Override
public Mono<Payload> requestResponse(Payload payload) {
    return delegate.requestResponse(payload).subscriberContext(ctx -> {
        // expecting that higher level subscriber context data would be available here...
        // same problem exists when using Mono.subscriberContext()...
        return ctx;
   });
}

I see that ctx is empty and is missing the data that was provided to the WeightedRSocket.
It appears that as LB is creating the handler chain the context is not properly propagated at some point.

Activity

  1. changed the title [-]LoadBalancedRSocketMono does not seem to propagate subscriber context properly[/-] [+]LoadBalancedRSocketMono (LatencySubscriber) does not seem to propagate subscriber context properly[/+] on May 7, 2020
  2. added this to the 1.1 M2 milestone on Aug 12, 2020
  3. modified the milestones: 1.1 M2, 1.1 RC1 on Sep 14, 2020
  4. modified the milestones: 1.1 RC1, 1.1.0 on Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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