Closed smira closed 1 week ago
Inspired by #369, follow-up for #372.
There are two major sources of goroutines launched by Omni which might not have panic protection:
errgroup.Go
go func()
I think we need to ensure all these runs have a panic handling mechanism.
I propose to add the following helper function:
func recoverPanic(f func() error, logger zap.Logger) (err error) { defer func() { if p := recover(); p != nil { .... err = logger. } }() return f()
And the introduce sub-versions of this function - the one which accepts func() and returns no error (for go func()) case.
func()
And then ensure that every invocation of a goroutine is wrapped accordingly
let's also make sure it's unit-tested :)
Inspired by #369, follow-up for #372.
There are two major sources of goroutines launched by Omni which might not have panic protection:
errgroup.Go
go func()
I think we need to ensure all these runs have a panic handling mechanism.
I propose to add the following helper function:
And the introduce sub-versions of this function - the one which accepts
func()
and returns no error (forgo func()
) case.And then ensure that every invocation of a goroutine is wrapped accordingly