Skip to content

Find, verify, and analyze leaked credentials

Record timestamp when a context was cancelled (#1018)

Miccah45b02f46d997
diff --git a/pkg/context/context.go b/pkg/context/context.go
index ff4de39cc..ef0df1086 100644
--- a/pkg/context/context.go
+++ b/pkg/context/context.go
@@ -166,6 +166,9 @@ func captureCancelCallstack(ctx logCtx, f context.CancelFunc) (Context, context.
}
f()
// Set the error with the stacktrace if the err pointer is non-nil.
- *ctx.err = fmt.Errorf("%w (%s)", ctx.Err(), string(debug.Stack()))
+ *ctx.err = fmt.Errorf(
+ "%w (canceled at %v\n%s)",
+ ctx.Err(), time.Now(), string(debug.Stack()),
+ )
}
}