Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions pkg/rsqueue/queue/work.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"context"
"fmt"
"log"
"runtime/debug"
"time"
)

Expand Down Expand Up @@ -86,9 +87,11 @@ func (a *OptionalRecurser) OptionallyRecurse(ctx context.Context, run func()) {
// Are we expecting recursion?
allowed := ctx.Value(CtxAllowsRecursion)
if allowed == nil {
msg := fmt.Sprintf("Work with type %d attempted recursion without being marked for recursion", r.WorkType)
msg := fmt.Sprintf("Work with type %d attempted recursion without being marked for recursion. "+
"The work's context reached a nested queue operation without ContextWithExpectedRecursion; "+
"mark the context in the work's runner.", r.WorkType)
if a.fatalRecurseCheck {
log.Fatal(msg)
log.Fatalf("%s Exiting because FatalRecurseCheck is enabled. Recursion stack:\n%s", msg, debug.Stack())
} else {
log.Println(msg)
}
Expand Down
Loading