Skip to content

Commit 84d6448

Browse files
committed
[jobmanager] Recover from job panics
Signed-off-by: Dmitrii Okunev <[email protected]>
1 parent fa98f00 commit 84d6448

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/jobmanager/jobmanager.go

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import (
1414
"time"
1515

1616
"github.com/facebookincubator/go-belt/beltctx"
17+
"github.com/facebookincubator/go-belt/tool/experimental/errmon"
1718
"github.com/insomniacslk/xjson"
1819

1920
"github.com/linuxboot/contest/pkg/api"
@@ -183,6 +184,9 @@ loop:
183184
logging.Debugf(ev.Context, "Handling event %+v", ev)
184185
handlerWg.Add(1)
185186
go func() {
187+
defer func() {
188+
errmon.ObserveRecoverCtx(ev.Context, recover())
189+
}()
186190
defer handlerWg.Done()
187191
jm.handleEvent(ev)
188192
}()

0 commit comments

Comments
 (0)