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

gRPC Streaming endpoints that throw errors crash the main process #13360

Closed
2 tasks done
ssilve1989 opened this issue Mar 26, 2024 · 2 comments
Closed
2 tasks done

gRPC Streaming endpoints that throw errors crash the main process #13360

ssilve1989 opened this issue Mar 26, 2024 · 2 comments
Labels
needs triage This issue has not been looked into type: bug 😭

Comments

@ssilve1989
Copy link
Contributor

ssilve1989 commented Mar 26, 2024

Did you read the migration guide?

  • I have read the whole migration guide

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Potential Commit/PR that introduced the regression

#13328

NestJS version

10.2.9 -> 10.3.5

Describe the regression

gRPC server streaming endpoints that throw errors now have nothing catching those errors resulting in an unhandledRejection crashing the application. This is the offending PR #13328

I will plan to work with @benlesh to get a PR up to resolve these as well as some other concerns ben has around the call.emit changes, and add test cases that prevent this issue in the future

Minimum reproduction code

https://github.com/ssilve1989/nest-grpc-streaming-regression

Input code

A simple rpc that throws an error crashes the entire application now

  @GrpcMethod('EchoService', 'StreamEcho')
  streamEcho(request: StreamEchoRequest): Observable<StreamEchoResponse> {
    throw new Error('oopsies');
  }

Expected behavior

The server responding to requests with gRPC Errors should not itself crash.

Other

papertrail of PRs that led to this issue

#12673
#13195
#13328

@ssilve1989 ssilve1989 added needs triage This issue has not been looked into type: bug 😭 labels Mar 26, 2024
@kamilmysliwiec
Copy link
Member

Thank you @ssilve1989! For now I just reverted the #13328 PR #13367

@ssilve1989
Copy link
Contributor Author

ssilve1989 commented Mar 27, 2024

Made the updates here: #13368 I couldn't think of a great commit message given the constraints of commitlint so happy to change it to whatever you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage This issue has not been looked into type: bug 😭
Projects
None yet
Development

No branches or pull requests

2 participants