Skip to content

Commit

Permalink
[jobmanager] Recover from job panics
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitrii Okunev <[email protected]>
  • Loading branch information
xaionaro committed Jul 4, 2023
1 parent fa98f00 commit 84d6448
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/jobmanager/jobmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"time"

"github.com/facebookincubator/go-belt/beltctx"
"github.com/facebookincubator/go-belt/tool/experimental/errmon"
"github.com/insomniacslk/xjson"

"github.com/linuxboot/contest/pkg/api"
Expand Down Expand Up @@ -183,6 +184,9 @@ loop:
logging.Debugf(ev.Context, "Handling event %+v", ev)
handlerWg.Add(1)
go func() {
defer func() {
errmon.ObserveRecoverCtx(ev.Context, recover())
}()
defer handlerWg.Done()
jm.handleEvent(ev)
}()
Expand Down

0 comments on commit 84d6448

Please sign in to comment.