Skip to content
Draft
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
11 changes: 10 additions & 1 deletion service/history/ndc/history_replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ package ndc

import (
ctx "context"
"fmt"
"runtime"
"time"

"github.com/pborman/uuid"
Expand Down Expand Up @@ -342,7 +344,14 @@ func (r *historyReplicatorImpl) applyEvents(
defer func() {
if rec := recover(); rec != nil {
releaseFn(errPanic)
panic(rec)
stack := make([]byte, 1<<14) // 16kb
n := runtime.Stack(stack, false)
stack = stack[:n]
if retError == nil {
retError = fmt.Errorf("panic: %v, stack: %s", rec, stack)
} else {
retError = fmt.Errorf("panic: %v, stack: %s, previous err: %w", rec, stack, retError)
}
} else {
releaseFn(retError)
}
Expand Down
Loading