{"record":{"id":"c7236e96e3e9a320","repo":"t8y2/dbx","slug":"agent-request-timed-out","errorCode":null,"errorMessage":"agent request timed out","messagePattern":"agent request timed out","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/kingbase-go/bench/agent_compare.go","lineNumber":249,"sourceCode":"\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprocess.writeMu.Lock()\n\t_, err = process.stdin.Write(append(payload, '\\n'))\n\tprocess.writeMu.Unlock()\n\tif err != nil {\n\t\tprocess.pending.Delete(id)\n\t\treturn nil, err\n\t}\n\tselect {\n\tcase response := <-channel:\n\t\tif response.Error != nil {\n\t\t\treturn nil, errors.New(response.Error.Message)\n\t\t}\n\t\treturn response.Result, nil\n\tcase <-time.After(30 * time.Second):\n\t\tprocess.pending.Delete(id)\n\t\treturn nil, errors.New(\"agent request timed out\")\n\t}\n}\n\nfunc (process *agentProcess) close() error {\n\t_, _ = process.call(\"shutdown\", map[string]any{})\n\t_ = process.stdin.Close()\n\treturn process.command.Wait()\n}\n\nfunc runQueryBenchmark(process *agentProcess, duration time.Duration, concurrency int, sqlText string, maxRows int, sampleMemory bool) benchmarkResult {\n\tvar operations atomic.Int64\n\tvar failures atomic.Int64\n\tvar peakRSS atomic.Int64\n\tstopMemory := make(chan struct{})\n\tif sampleMemory {\n\t\tpeakRSS.Store(readRSSKB(process.command.Process.Pid))\n\t\tgo func() {\n\t\t\tticker := time.NewTicker(100 * time.Millisecond)","sourceCodeStart":231,"sourceCodeEnd":267,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/kingbase-go/bench/agent_compare.go#L231-L267","documentation":"An agent RPC that does not receive a response within a fixed 30-second window times out; the pending request is removed and this error returned. It indicates the agent process is hung, dead, or too slow rather than returning an error reply.","triggerScenarios":"Calling process.call (from close, warmup, benchmarkOneConnection, cleanupQueryPage, etc.) when the agent writes no reply to the response channel within 30 seconds.","commonSituations":"The agent process crashed or deadlocked so the reply never arrives; a long-running query exceeds 30s; the agent's stdout reply was lost or blocked; slow machine/IO under benchmark load.","solutions":["Check whether the agent process is alive (logs, exit status) and restart it if it crashed or hung","Reduce query workload or increase the 30s timeout constant for legitimately long operations","Ensure the agent always writes exactly one response per request, even on internal errors"],"exampleFix":"// before\ncase <-time.After(30 * time.Second):\n// after\ntimeout := 60 * time.Second // configurable for long-running queries\ncase <-time.After(timeout):","handlingStrategy":"retry","validationCode":"if process.exited() { return errors.New(\"agent process is not running; restart before calling\") }","typeGuard":null,"tryCatchPattern":"res, err := process.call(method, args); if err != nil && err.Error() == \"agent request timed out\" { // restart agent and retry once with a longer deadline\n}","preventionTips":["Make the 30s timeout configurable for long-running queries","Monitor the agent process health (liveness check) and restart it on hang/crash","Ensure the agent replies to every request exactly once, including error paths"],"tags":["timeout","ipc","agent"],"backgroundTag":"request-timeout","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}