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

Proposed goroutine wrapper solution #1157

Merged
merged 12 commits into from
Jun 21, 2024

Conversation

madisonchamberlain
Copy link
Contributor

Description

As discussed in slack, I would like to have the ability to wrap a panic in a go routine, rather than letting it crash our service. We want to simply use the recover function to grab the panic, and then send that panic to sentry (the service we use to track errors). For us this would make debugging easier and more productive.

I have added a variable GoroutineWrapper which is a function that takes in a function. I call this variable around all of the goroutines that are spawned throughout the codebase. On init, a caller can provide a function which does what it wants to wrap goroutines. If nothing is specified, we fallback on defaultDoesNothing which just calls the goroutine with no wrapping/handling as is happening now. Please let me know your thoughts, I am happy to change anything!

Checklist

  • Created tests which fail without the change (if possible)
  • Extended the README / documentation, if necessary - I will do this once we are in a state of knowing for sure how we want this to look/if this is something we want to do

@madisonchamberlain madisonchamberlain requested a review from a team as a code owner June 13, 2024 23:04
authexternalbrowser.go Outdated Show resolved Hide resolved
function_wrapper_test.go Show resolved Hide resolved
function_wrapper_test.go Outdated Show resolved Hide resolved
function_wrapper_test.go Outdated Show resolved Hide resolved
function_wrappers.go Outdated Show resolved Hide resolved
@sfc-gh-pfus sfc-gh-pfus merged commit bea18fc into snowflakedb:master Jun 21, 2024
35 of 37 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants