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

FIX catch stream errors in grpc #12673

Merged
merged 1 commit into from Nov 17, 2023

Conversation

Hellomik2002
Copy link
Contributor

@Hellomik2002 Hellomik2002 commented Oct 30, 2023

At the current moment if you throw error in stream, It will throw all app, but with this fix error will be handled, and server will not fall dawn

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

At the current moment if you throw error in stream, It will throw all app, but with this fix error will be handled, and server will not fall dawn
@Hellomik2002 Hellomik2002 changed the title FIX catch stream errors FIX catch stream errors in grpc Oct 30, 2023
@coveralls
Copy link

Pull Request Test Coverage Report for Build d6d6eb9f-b99a-461b-bda2-a3392e148782

  • 2 of 4 (50.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 92.236%

Changes Missing Coverage Covered Lines Changed/Added Lines %
packages/microservices/server/server-grpc.ts 2 4 50.0%
Totals Coverage Status
Change from base Build 3770aab0-7e99-46e0-b1a8-34ce234c1890: -0.02%
Covered Lines: 6688
Relevant Lines: 7251

💛 - Coveralls

@kamilmysliwiec
Copy link
Member

Can you add tests for this change?

@Hellomik2002
Copy link
Contributor Author

You already have tests, but don't include that case, I am not sure that can write it right

@kamilmysliwiec
Copy link
Member

Could you provide a minimum reproduction repository then? (that reproduces your issue)

@Hellomik2002
Copy link
Contributor Author

Hellomik2002 commented Nov 3, 2023

You can write any stream function and do throw as first action

listenUser(
    messages: Observable<proto.EmptyBody>,
    metaData?: Metadata,
    duplex?: ServerDuplexStreamImpl<
      proto.UpdateLocationInput,
      proto.OrdersResponce
    >,
  ): Observable<proto.OrdersResponce> {
  throw 'Any thing';
  }

it will crash Application

@kamilmysliwiec kamilmysliwiec merged commit a3f3b97 into nestjs:master Nov 17, 2023
3 checks passed
@NAlexandrov NAlexandrov mentioned this pull request Feb 8, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants