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

'end' event not being sent for server-side streaming call #1315

Open
lily-es opened this issue Jan 20, 2023 · 3 comments
Open

'end' event not being sent for server-side streaming call #1315

lily-es opened this issue Jan 20, 2023 · 3 comments

Comments

@lily-es
Copy link

lily-es commented Jan 20, 2023

When performing a client call to a server-side streaming service, I never receive the 'end' event. The server implementation is in kotlin. Im using protoc-gen-grpc-web 1.4.2

This is my client code.

  const stream = getDataClient().generateBulkStatistics(request, metadata);
  stream
    .on('data', (response: ExampleResponse) => {
      console.log('Received data');
    })
    .on('error', (error: RpcError) => {
      console.log('Received error');
    })
    .on('end', () => {
      console.log('Received end');
    });

This is my protoc config

protoc \
  --js_out=import_style=commonjs,binary:$OUTPUT_FOLDER \
  --grpc-web_out=import_style=typescript,mode=grpcwebtext:$OUTPUT_FOLDER \
@sampajano
Copy link
Collaborator

@lily-es Thanks for the report!

When performing a client call to a server-side streaming service, I never receive the 'end' event. The server implementation is in kotlin. Im using protoc-gen-grpc-web 1.4.2

To confirm, I assume you observe this in a successful (non-error) streaming case, is that right?

I tried using the following TS example but unable to reproduce:
https://github.com/grpc/grpc-web/tree/master/net/grpc/gateway/examples/echo/ts-example

I'm able to see the stream end signal received message printed in console:
Screenshot 2023-02-07 at 4 41 26 PM

I'm wondering if it has something to do with your Kotlin server potentially? (We're using a Node server in our example.)

Also i assume you're using Envoy too, is that right?

Thanks!

@heggi
Copy link

heggi commented Feb 16, 2023

This problem exists if grpc requests is proxied via webpack dev server.
This is a standard scenario during the development of frontend app, but any disconnects and backend's reboots don't emit 'error' and 'end' events in client.
After building release bundle and running on server, all works correctly.

@maja42
Copy link

maja42 commented Sep 19, 2023

Maybe this is related to #1363. For us, this is a PROD issue. The front proxy is nginx, with envoy behind it.
However, the Browser detects and logs the issue, so I suspect it's an issue in this library, not a proxy misconfiguration

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

No branches or pull requests

4 participants