{"record":{"id":"706f203d89785676","repo":"JuliusBrussee/caveman","slug":"cachebench-replay-preparation-interrupted-w","errorCode":null,"errorMessage":"cachebench: replay preparation interrupted: %w","messagePattern":"cachebench: replay preparation interrupted: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":505,"sourceCode":"\t}\n\tanchorTrace, _ := time.Parse(time.RFC3339Nano, records[0].At)\n\tanchorReal := now().UTC()\n\tif runner.Limits.MaxConcurrency == 1 {\n\t\treturn runner.runSequential(ctx, prepared, anchorTrace, anchorReal, now, sleep, emit)\n\t}\n\treturn runner.runConcurrent(ctx, prepared, anchorTrace, anchorReal, now, sleep, emit)\n}\n\ntype preparedReplay struct {\n\trecord    TraceRecord\n\toptimized cacheengine.NativeResult\n}\n\nfunc (runner ReplayRunner) prepare(ctx context.Context, records []TraceRecord) ([]preparedReplay, error) {\n\tprepared := make([]preparedReplay, 0, len(records))\n\tfor _, record := range records {\n\t\tif err := ctx.Err(); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: replay preparation interrupted: %w\", err)\n\t\t}\n\t\tnative, err := record.NativeRequest()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\toptimized, err := runner.Engine.Optimize(ctx, native)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"cachebench: optimize request %q: %w\", record.RequestID, err)\n\t\t}\n\t\tequivalent := bytes.Equal(native.Body, optimized.Body)\n\t\tif optimized.Applied {\n\t\t\tequivalent = ModelVisibleEquivalent(native.Body, optimized.Body)\n\t\t}\n\t\tif !equivalent {\n\t\t\treturn nil, &ReplayRunError{\n\t\t\t\tRequestID: record.RequestID, FailureCode: \"model_visible_mismatch\",\n\t\t\t\tErr: fmt.Errorf(\"cachebench: request %q failed model-visible equivalence\", record.RequestID),\n\t\t\t}","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cachebench/replay.go#L487-L523","documentation":"ReplayRunner.prepare aborted because the context was cancelled or its deadline expired while preparing records (running engine eligibility). The wrapped context error indicates external interruption, not a data problem.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:505 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Extend the run deadline for large traces","Avoid cancelling the replay context mid-preparation"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"766dce6b1394ebb56a3090748d5a0240a5aefb36","analyzedAt":"2026-08-18T03:14:35.516Z","contentChangedAt":"2026-08-18T03:14:35.516Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}