Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Detect missing panic recovery in goroutines in plugins #5

Open
insomniacslk opened this issue Feb 4, 2020 · 1 comment
Open

Detect missing panic recovery in goroutines in plugins #5

insomniacslk opened this issue Feb 4, 2020 · 1 comment

Comments

@insomniacslk
Copy link
Contributor

Panic in goroutines other than the main one cannot be recovered explicitly, they have to be handled in the goroutine itself[1].
For ConTest this means that if a test step or any other plugin has a goroutine that panics, we are not able to catch it.

We should write a tool to detect (statically or dynamically) whether each spawned goroutine attempts to recover, and warn that the plugin may break the service run.

[1] https://stackoverflow.com/questions/50409011/handling-panics-in-go-routines

@xaionaro
Copy link
Contributor

xaionaro commented Mar 2, 2020

We may:

  • Write a special function to create safe goroutines, we may declare it as goroutine.Run(func()).
  • Write a static-analysis tool using the go/ set of packages to find any direct go use (and warn about it). This way we will enforce to use goroutine.Run instead. This should be easy because there's method Inspect out-of-the-box. So we just need to call Inspect() and comparing incoming data with go.

What are your thoughts?


Update: Looks relevant: https://github.com/studiosol/async

mimir-d pushed a commit to mimir-d/fb_contest that referenced this issue Oct 29, 2021
add cpucmd, which uses the cpu package
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants