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(alerting): add recover for possible panics #1445

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iamKunalGupta
Copy link
Contributor

This is for preventing non-critical alerting/telemetry code-flow from taking down the workflow during a panic

@@ -74,7 +75,26 @@ func NewAlerter(ctx context.Context, catalogPool *pgxpool.Pool) *Alerter {
}
}

func withPanicGuard(ctx context.Context, functionName string, f func()) {
Copy link
Member

Choose a reason for hiding this comment

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

Can compute functionName on error, see second example https://stackoverflow.com/a/38551362

@serprex
Copy link
Member

serprex commented Mar 7, 2024

Personally I lean towards letting logging panics crash things, all bugs are bugs

@iskakaushik iskakaushik marked this pull request as draft March 18, 2024 12:47
@CLAassistant
Copy link

CLAassistant commented May 21, 2024

CLA assistant check
All committers have signed the CLA.

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 this pull request may close these issues.

None yet

3 participants