{"record":{"id":"adebc3cafa65d2fc","repo":"musistudio/claude-code-router","slug":"request-log-admission-bound-reached-oldest-f","errorCode":null,"errorMessage":"[request-log] Admission ${bound} reached; oldest fail-closed state was released.","messagePattern":"\\[request-log\\] Admission (.+?) reached; oldest fail-closed state was released\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/core/src/observability/request-log-runtime.ts","lineNumber":636,"sourceCode":"      this.admissionOverlay.delete(requestId);\n    }\n  }\n\n  private settleAdmissionOperation(operationId: number, operation: AdmissionOperation): void {\n    this.admissionOperations.delete(operationId);\n    if (operation.key) this.admissionOperationKeys.delete(operation.key);\n    if (!operation.overlayRequestId || operation.overlayVersion === undefined) return;\n    const overlay = this.admissionOverlay.get(operation.overlayRequestId);\n    if (overlay?.version === operation.overlayVersion) {\n      this.admissionOverlay.delete(operation.overlayRequestId);\n    }\n  }\n\n  private warnAdmissionBound(bound: string): void {\n    const now = Date.now();\n    if (now - this.admissionLastWarningAt < 30_000) return;\n    this.admissionLastWarningAt = now;\n    console.warn(`[request-log] Admission ${bound} reached; oldest fail-closed state was released.`);\n  }\n\n  private ensureAdmissionHeartbeat(): void {\n    if (this.admissionHeartbeatTimer || this.closed) return;\n    this.admissionHeartbeatTimer = setInterval(() => {\n      this.submitAdmissionOperation({\n        attempts: 0,\n        createdAt: Date.now(),\n        key: \"heartbeat\",\n        run: (store) => {\n          store.heartbeat(this.runtimeId);\n          const now = Date.now();\n          if (now - this.admissionLastPrunedAt >= 60 * 60 * 1_000) {\n            store.prune(now);\n            this.admissionLastPrunedAt = now;\n          }\n        }\n      });","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/musistudio/claude-code-router/blob/99f24806c6a2c660b16e53e95211c517448a6c90/packages/core/src/observability/request-log-runtime.ts#L618-L654","documentation":"The request-log runtime enforces admission bounds (limits on in-flight fail-closed logging state). When a bound is hit, the oldest fail-closed state is released to make room, and this warning (rate-limited to once per 30s) is emitted. It signals the logging pipeline is saturated and back-pressure is shedding load.","triggerScenarios":"Sustained high request volume where writers cannot drain commands fast enough; slow or blocked log storage (disk I/O stall, locked DB); many concurrent fail-closed capture operations exceeding the admission limit.","commonSituations":"Disk saturation or a slow filesystem causing the log writer to lag; a burst of gateway traffic; a stuck downstream writer making the queue grow unboundedly until admission control kicks in.","solutions":["Investigate writer throughput: check disk I/O, storage health, and whether a writer is stuck","Reduce logging volume (raise sampling, relax capture policies) if traffic legitimately exceeds capacity","Scale or move the log store to faster storage","Treat repeated warnings as capacity planning signal — the runtime is protecting itself, but data may be dropped"],"exampleFix":"// before: verbose capture on every request\nrequestLog: { capture: { policy: \"always\", includeBodies: true } }\n\n// after: sample and skip bodies to reduce admission pressure\nrequestLog: { capture: { policy: \"sampled\", sampleRate: 0.1, includeBodies: false } }","handlingStrategy":"fallback","validationCode":"const canAccept = runtime.admissionUsage().inFlight < runtime.admissionUsage().limit;\nif (!canAccept) degradeToFailOpenLogging();","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision log storage IOPS to match peak traffic","Sample or truncate captured bodies under load","Alert on repeated admission warnings as a capacity signal"],"tags":["backpressure","request-log","capacity","observability"],"backgroundTag":"queue-backpressure-shedding","analyzedSha":"99f24806c6a2c660b16e53e95211c517448a6c90","analyzedAt":"2026-08-27T04:11:01.184Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}