{"record":{"id":"b35b8c2b4418ba4f","repo":"aeron-io/aeron","slug":"failed-to-send-bounded-replay-request","errorCode":null,"errorMessage":"failed to send bounded replay request","messagePattern":"failed to send bounded replay request","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java","lineNumber":1102,"sourceCode":"        lock.lock();\n        try\n        {\n            ensureConnected();\n            ensureNotReentrant();\n\n            lastCorrelationId = aeron.nextCorrelationId();\n\n            if (!archiveProxy.boundedReplay(\n                recordingId,\n                position,\n                length,\n                limitCounterId,\n                replayChannel,\n                replayStreamId,\n                lastCorrelationId,\n                controlSessionId))\n            {\n                throw new ArchiveException(\"failed to send bounded replay request\");\n            }\n\n            return pollForResponse(lastCorrelationId);\n        }\n        finally\n        {\n            lock.unlock();\n        }\n    }\n\n    /**\n     * Start a replay for a recording based upon the parameters set in ReplayParams. By default, it will replay\n     * all the recording from the start. The ReplayParams is free to be reused when this call completes.\n     *\n     * @param recordingId    to be replayed.\n     * @param replayChannel  to which the replay should be sent.\n     * @param replayStreamId to which the replay should be sent.\n     * @param replayParams   optional parameters for the replay","sourceCodeStart":1084,"sourceCodeEnd":1120,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L1084-L1120","documentation":"startBoundedReplay sends a BOUNDED_REPLAY request that attaches a limit counter to cap replay length. ArchiveProxy.boundedReplay returning false (publication not connected, offer failed) means the request was never delivered, so the library throws this ArchiveException.","triggerScenarios":"Calling startBoundedReplay(recordingId, position, length, limitCounterId, replayChannel, replayStreamId) while the control-request publication is disconnected or backpressured — archive down/restarting, network partition, or a closed control session.","commonSituations":"Bounded replays used by monitoring/scrubbing tools that run while the archive is under load; control stream backpressure when many clients share one control channel; archive redeployment between issuing and replaying.","solutions":["Check archive health and control channel connectivity.","Reconnect via AeronArchive.connect and retry the bounded replay.","Retry with backoff to ride out transient backpressure.","Ensure the limitCounterId counter is valid/registered in the same Aeron client before retrying."],"exampleFix":"// before\nlong sessionId = archive.startBoundedReplay(recId, pos, len, counterId, ch, streamId);\n\n// after\ntry {\n    sessionId = archive.startBoundedReplay(recId, pos, len, counterId, ch, streamId);\n} catch (ArchiveException e) {\n    archive = AeronArchive.connect(archiveCtx);\n    sessionId = archive.startBoundedReplay(recId, pos, len, counterId, ch, streamId);\n}","handlingStrategy":"retry","validationCode":"if (limitCounterId <= 0) throw new IllegalArgumentException(\"invalid limitCounterId\");\ntry (AeronArchive ignored = AeronArchive.connect(archiveCtx)) {}","typeGuard":"boolean canReplay(AeronArchive a) { return a != null && !a.isClosed() && a.state() == AeronArchive.State.CONNECTED; }","tryCatchPattern":"try {\n    long sid = archive.startBoundedReplay(recId, pos, len, counterId, ch, streamId);\n} catch (ArchiveException e) {\n    archive = AeronArchive.connect(archiveCtx);\n    retryWithBackoff(() -> archive.startBoundedReplay(recId, pos, len, counterId, ch, streamId));\n}","preventionTips":["Verify the archive is live before bounded replays.","Register the limit counter in the same Aeron client used by the archive context.","Use backoff for control-stream backpressure.","Reconnect sessions after archive restarts."],"tags":["aeron","archive","replay","network"],"backgroundTag":"api-request-failed","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}