{"record":{"id":"c4bddf5d111dd90a","repo":"JuliusBrussee/caveman","slug":"cache-replay-concurrent-response-and-verifier-buf","errorCode":null,"errorMessage":"cache-replay: concurrent response and verifier buffers exceed %d bytes","messagePattern":"cache-replay: concurrent response and verifier buffers exceed (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cacheengine/cmd/cache-replay/main.go","lineNumber":222,"sourceCode":"\tmaxResponseBytes := flag.Int64(\"max-response-bytes\", 16<<20, \"maximum retained provider response bytes/request\")\n\tproviderTimeout := flag.Duration(\"provider-timeout\", 2*time.Minute, \"hard timeout per provider request (1s-1h)\")\n\tverifierPath := flag.String(\"verifier-command\", \"\", \"task verifier executable; receives one JSON object on stdin\")\n\tverifierOutputBytes := flag.Int64(\"max-verifier-output-bytes\", 16<<20, \"maximum verifier JSON bytes/request\")\n\ttargetRate := flag.Float64(\"target\", .97, \"required request and token cache-hit rate\")\n\tminEligible := flag.Int(\"min-requests\", 100, \"minimum eligible requests/provider\")\n\tallowInsecureLoopback := flag.Bool(\"allow-insecure-loopback\", false, \"allow HTTP only for explicit loopback test base URLs\")\n\tallowCustomBaseURL := flag.Bool(\"allow-custom-base-url\", false, \"confirm credentials may be sent to explicit custom HTTPS base URLs\")\n\tverifierTimeout := flag.Duration(\"verifier-timeout\", 5*time.Minute, \"hard timeout per task-verifier invocation\")\n\tflag.Var(&verifierArgs, \"verifier-arg\", \"verifier argument; repeatable, no shell parsing\")\n\tflag.Var(&verifierEnv, \"verifier-env\", \"environment variable exposed to verifier; repeatable\")\n\tflag.Var(&baseURLs, \"base-url\", \"test/custom provider base URL as provider=https://host; repeatable\")\n\tflag.Parse()\n\n\tif *tracePath == \"\" || !filepath.IsAbs(*tracePath) || *maxRequests <= 0 || *maxRequests > maxReplayRequests || *maxTokens <= 0 || *maxTraceBytes <= 0 || *maxTraceBytes > maxReplayTraceBytes || *maxResponseBytes <= 0 || *maxResponseBytes > 256<<20 || *providerTimeout < time.Second || *providerTimeout > time.Hour || *verifierOutputBytes <= 0 || *verifierOutputBytes > 256<<20 || *verifierTimeout <= 0 || *maxScheduleDrift <= 0 || *maxConcurrency <= 0 || *maxConcurrency > 1024 {\n\t\tfatalConfig(errors.New(\"cache-replay: -trace and positive request/token/trace/response/verifier limits required\"))\n\t}\n\tif (*maxResponseBytes+*verifierOutputBytes)*int64(*maxConcurrency) > maxReplayInflightBytes {\n\t\tfatalConfig(fmt.Errorf(\"cache-replay: concurrent response and verifier buffers exceed %d bytes\", maxReplayInflightBytes))\n\t}\n\tif len(baseURLs) > 0 && !*allowCustomBaseURL {\n\t\tfatalConfig(errors.New(\"cache-replay: custom base URLs require -allow-custom-base-url\"))\n\t}\n\trecords, traceSHA, err := readTrace(*tracePath, *maxTraceBytes, *maxRequests)\n\tif err != nil {\n\t\tfatalConfig(err)\n\t}\n\tlimits := cachebench.ReplayLimits{\n\t\tMaxRequests: *maxRequests, MaxDeclaredBilledTokens: *maxTokens, MaxGap: *maxGap, MaxScheduleDrift: *maxScheduleDrift,\n\t\tMaxConcurrency:        *maxConcurrency,\n\t\tRequireGroundedTiming: !*allowUngrounded, RequireProviderTokens: !*allowEstimatedTokens,\n\t}\n\tpreflight, err := cachebench.ValidateReplay(records, limits, *timeScale)\n\tif err != nil {\n\t\tfatalConfig(err)\n\t}\n\ttarget := cachebench.Target{RequestHitRate: *targetRate, TokenHitRate: *targetRate, MinEligibleRequest: *minEligible}","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/766dce6b1394ebb56a3090748d5a0240a5aefb36/cacheengine/cmd/cache-replay/main.go#L204-L240","documentation":"Raised in cache-replay's main: the product of concurrency, max-response-bytes, and max-verifier-output-bytes exceeds the hard cap on concurrent retained buffers. It is a pre-flight guard: the requested in-memory evidence retention would exceed the configured ceiling before any request is issued.","triggerScenarios":"Thrown at cacheengine/cmd/cache-replay/main.go:222 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Lower -concurrency so retained response plus verifier buffers fit under the cap","Reduce -max-response-bytes or -max-verifier-output-bytes","Raise the buffer ceiling if the host genuinely has the memory to support the requested configuration"],"exampleFix":null,"handlingStrategy":"validation","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"}