{"record":{"id":"cba2fcd6e12eeaef","repo":"JuliusBrussee/caveman","slug":"cachebench-replay-schedule-duration-overflow","errorCode":null,"errorMessage":"cachebench: replay schedule duration overflow","messagePattern":"cachebench: replay schedule duration overflow","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cachebench/replay.go","lineNumber":412,"sourceCode":"\t\t}\n\t\ttokens[record.TokenBasis] = true\n\t\tif record.DeclaredInputTokens <= 0 || record.DeclaredInputTokens < record.PrefixTokens || record.MaxOutputTokens <= 0 || !requestBudgetMatchesBody(record) {\n\t\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: replay request %q has invalid billed-token budget\", record.RequestID)\n\t\t}\n\t\tinput, output := int64(record.DeclaredInputTokens), int64(record.MaxOutputTokens)\n\t\tif input > limits.MaxDeclaredBilledTokens-worstCase || output > limits.MaxDeclaredBilledTokens-worstCase-input {\n\t\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: replay declared billed-token ceiling exceeds limit %d\", limits.MaxDeclaredBilledTokens)\n\t\t}\n\t\tdeclaredInput += input\n\t\tdeclaredOutput += output\n\t\tworstCase += input + output\n\t\tif !previous.IsZero() {\n\t\t\tgap, err := scaledReplayGap(at.Sub(previous), timeScale)\n\t\t\tif err != nil || gap > limits.MaxGap {\n\t\t\t\treturn ReplayPreflight{}, fmt.Errorf(\"cachebench: replay gap before %q exceeds limit %s\", record.RequestID, limits.MaxGap)\n\t\t\t}\n\t\t\tif int64(gap) > math.MaxInt64-scheduled {\n\t\t\t\treturn ReplayPreflight{}, errors.New(\"cachebench: replay schedule duration overflow\")\n\t\t\t}\n\t\t\tscheduled += int64(gap)\n\t\t}\n\t\tprevious = at\n\t}\n\tbases := make([]string, 0, len(timing))\n\tfor basis := range timing {\n\t\tbases = append(bases, basis)\n\t}\n\tsort.Strings(bases)\n\ttokenBases := make([]string, 0, len(tokens))\n\tfor basis := range tokens {\n\t\ttokenBases = append(tokenBases, basis)\n\t}\n\tsort.Strings(tokenBases)\n\treturn ReplayPreflight{\n\t\tRequests: len(records), DeclaredInputTokens: declaredInput,\n\t\tDeclaredMaxOutputTokens: declaredOutput, DeclaredBilledTokens: worstCase,","sourceCodeStart":394,"sourceCodeEnd":430,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/27d5a3981a347890211bb1bf2439e5c821a63bc9/cacheengine/cachebench/replay.go#L394-L430","documentation":"Error \"cachebench: replay schedule duration overflow\" thrown in JuliusBrussee/caveman.","triggerScenarios":"Thrown at cacheengine/cachebench/replay.go:412 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reduce the replay schedule so the total duration does not overflow."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"27d5a3981a347890211bb1bf2439e5c821a63bc9","analyzedAt":"2026-08-15T09:26:11.751Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}