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

[SERF-1677] Add recovery middleware for GRPC and HTTP server #109

Merged
merged 2 commits into from
Jun 19, 2024

Conversation

laynax
Copy link
Contributor

@laynax laynax commented Jun 18, 2024

Description

In this PR, we add a new HTTP middleware and a GRPC interceptor which both serves one purpose, panic recovery in the service endpoint level.

Based on this change, after a panic in an endpoint, the services will:

  • Send a sentry event
  • Log the panic error in Fatal level
  • Exit the program

Testing considerations

This was tested on go-chassis dev env applying both middlewares.
Sentry events (with both HTTP and GRPC panics) here and datadog logs here

Checklist

  • Prefixed the PR title with the JIRA ticket code
  • Performed simple, atomic commits with [good commit messages][commit messages]
  • Verified that the commit history is linear and commits are squashed as necessary
  • Thoroughly tested the changes in development and/or staging
  • Updated the README.md as necessary

Related links

@laynax laynax force-pushed the laynax/SERF-1677/rec-mw branch 3 times, most recently from fe7c3a3 to 71101e4 Compare June 19, 2024 11:13
@laynax laynax marked this pull request as ready for review June 19, 2024 11:22
@laynax laynax requested a review from a team as a code owner June 19, 2024 11:22
@laynax laynax requested review from terranisu and fotos June 19, 2024 11:22
Copy link
Contributor

@fotos fotos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments/questions. 💬

pkg/interceptors/recovery.go Outdated Show resolved Hide resolved
pkg/interceptors/recovery.go Show resolved Hide resolved
Copy link
Contributor

@fotos fotos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 LGTM 🚀

Tagging @Neurostep to re-review after PTO.

@laynax laynax merged commit 0f33a13 into main Jun 19, 2024
6 checks passed
@laynax laynax deleted the laynax/SERF-1677/rec-mw branch June 19, 2024 15:53
@laynax laynax changed the title [SERF-1677] Add recovery middleware for GRPC server [SERF-1677] Add recovery middleware for GRPC and HTTP server Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants