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

Server-side streaming thrown errors are not propagating to client #607

Closed
davidfiala opened this issue Jun 4, 2024 · 1 comment · Fixed by #609
Closed

Server-side streaming thrown errors are not propagating to client #607

davidfiala opened this issue Jun 4, 2024 · 1 comment · Fixed by #609

Comments

@davidfiala
Copy link
Contributor

Using nice-grpc and/or nice-grpc-web as both the client and server:

"nice-grpc": "2.1.8",
"nice-grpc-common": "2.0.2",

with grpc-js pinned to 1.10.6 - which is admittedly not known to be supported (#555). the bug could be related to this.

trimmed example:

  async *myRpc(
    request: r.MyRequest,
    context: CallContext,
  ): r.ServerStreamingMethodResult<r.MyResponse> {
    console.error('okok');
    throw new ServerError(Status.ALREADY_EXISTS, 'blahlbhahala');
    // same bug if I yield* to something that throws
  }
const stream = client.myRpc({ });
for await ( const msg of stream ) { console.log(msg); }
catch(e) { console.error('error', e); }
finally { console.log('got finally'); }

I've observed that the server does log the okok but silently does nothing on the throw. The client will async iterate on server responses, and if any are sent it will receive them up until the throw. Once a server throw occurs, it seems like the client neither gets a catch nor finally. Just hangs.

@aikoven
Copy link
Contributor

aikoven commented Jun 4, 2024

It seems very likely to me to be caused by grpc-js 1.10.

The failing tests catch this situation here: https://github.com/deeplay-io/nice-grpc/actions/runs/9346639886/job/25721924757#step:7:573

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

Successfully merging a pull request may close this issue.

2 participants