Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing onComplete in requestStream and requestChannel with fragmentation #641

Closed
lksvenoy-r7 opened this issue May 21, 2019 · 5 comments · Fixed by #761
Closed

Missing onComplete in requestStream and requestChannel with fragmentation #641

lksvenoy-r7 opened this issue May 21, 2019 · 5 comments · Fixed by #761

Comments

@lksvenoy-r7
Copy link

lksvenoy-r7 commented May 21, 2019

When using fragmentation, the onComplete signal is sometimes missing with requestStream and requestChannel. This has been observed using many different fragmentation values (from 64 and up), and the behaviour is different locally than it is when using it over internet.

Expected Behaviour: When fragmentation is enabled, granted there are no errors, the entire payload is received by the client and the server finished by sending the COMPLETE frame.

Actual Behaviour: When fragmentation is enabled, when communicating over the internet, the socket is inconsistent, sometimes producing all payloads and the completion signal, and sometimes the payload amount varies, and no completion signal is issued.

Steps to Reproduce

  1. Create an rsocket server using the websocket transport protocol on an external server
  2. Create an rsocket client using the websocket transport protocol.
  3. Enable fragmentation on both server and client
  4. Send a big item and observe the onCompletion signal never arriving

Additional Information
Rsocket Version: 0.12.2-RC2
Infrastructure (Amazon): Rsocket Client -> Kong ALB -> Kong -> Service ALB -> Service

The behaviour works as expected when testing locally, but not over the internet. The load balancers have been tested and are not the issue.

Workaround
The current workaround we are using is to disable fragmentation, which resolves the issue.

If you require additional information, please let me know.

@robertroeser
Copy link
Member

Haven't gotten a chance to look at this in depth but there is a change this could be related to some structural changes in 0.12.2-RC2. Have you had a chance to try this with 0.12.2-RC3?

@lksvenoy-r7
Copy link
Author

Haven't gotten a chance to look at this in depth but there is a change this could be related to some structural changes in 0.12.2-RC2. Have you had a chance to try this with 0.12.2-RC3?

I haven't gotten a chance to look at this yet as I am too busy at this moment, but I'll update this ticket once it becomes relevant again. I had previously enabled it to fix an issue where my payload was too big, but this issue went away in a later update so fragmentation was no longer necessary for us.

@robertroeser
Copy link
Member

Ok - thanks for checking - @mostroverkhov is looking into this - we'll let you know.

@robertroeser
Copy link
Member

@lksvenoy-r7 did you get a chance to try @mostroverkhov fix?

@rstoyanchev
Copy link
Contributor

I can't reproduce this. The following:

Payload payload =
    DefaultPayload.create(Flux.just("a").repeat(1024 * 1024).collect(Collectors.joining()).block());

RSocketServer.create(
        (setup, socket) ->
            Mono.just(
                new AbstractRSocket() {
                  @Override
                  public Mono<Payload> requestResponse(Payload p) {
                    return Mono.just(p);
                  }
                }))
    .fragment(64)
    .bind(WebsocketServerTransport.create("localhost", 7000))
    .subscribe();

RSocket socket =
    RSocketConnector.create()
      .fragment(64)
      .connect(WebsocketClientTransport.create("localhost", 7000)).block();

socket
    .requestResponse(payload)
    .map(Payload::getDataUtf8)
    .doOnNext(x -> System.out.println("got item size: " + x.length()))
    .doOnTerminate(() -> System.out.println("done"))
    .block();

Prints:

got item size: 1048577
done

@lksvenoy-r7 please provide more details on how to reproduce or ideally a sample.

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

Successfully merging a pull request may close this issue.

4 participants