{"record":{"id":"02d4c5d84be6a9fb","repo":"aeron-io/aeron","slug":"failed-to-send-extend-recording-request","errorCode":null,"errorMessage":"failed to send extend recording request","messagePattern":"failed to send extend recording request","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java","lineNumber":781,"sourceCode":"     */\n    public long extendRecording(\n        final long recordingId,\n        final String channel,\n        final int streamId,\n        final SourceLocation sourceLocation)\n    {\n        lock.lock();\n        try\n        {\n            ensureConnected();\n            ensureNotReentrant();\n\n            lastCorrelationId = aeron.nextCorrelationId();\n\n            if (!archiveProxy.extendRecording(\n                channel, streamId, sourceLocation, recordingId, lastCorrelationId, controlSessionId))\n            {\n                throw new ArchiveException(\"failed to send extend recording request\");\n            }\n\n            return pollForResponse(lastCorrelationId);\n        }\n        finally\n        {\n            lock.unlock();\n        }\n    }\n\n    /**\n     * Extend an existing, non-active recording of a channel and stream pairing.\n     * <p>\n     * The channel must be configured for the initial position from which it will be extended. This can be done\n     * with {@link ChannelUriStringBuilder#initialPosition(long, int, int)}. The details required to initialise can\n     * be found by calling {@link #listRecording(long, RecordingDescriptorConsumer)}.\n     *\n     * @param recordingId    of the existing recording.","sourceCodeStart":763,"sourceCodeEnd":799,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L763-L799","documentation":"extendRecording sends an ExtendRecordingRequest to record into an existing recording identified by recordingId. If ArchiveProxy.extendRecording returns false — the request could not be offered on the control publication — the library throws ArchiveException because the archive never received the request.","triggerScenarios":"Calling AeronArchive.extendRecording(channel, streamId, sourceLocation, recordingId) when the control publication cannot accept the message: session down, back-pressure, or buffer full.","commonSituations":"Extending a recording after an archive restart with a stale control session; heavy control-channel load; archive unreachable mid-operation.","solutions":["Verify the control session is connected and retry extendRecording with back-off","Confirm recordingId refers to an existing recording and the archive is healthy","Catch ArchiveException, reconnect, and re-issue the extend request"],"exampleFix":"// before\narchive.extendRecording(channel, streamId, SourceLocation.LOCAL, recordingId); // may throw on send failure\n// after\ntry {\n    archive.extendRecording(channel, streamId, SourceLocation.LOCAL, recordingId);\n} catch (ArchiveException ex) {\n    Thread.sleep(200);\n    archive.extendRecording(channel, streamId, SourceLocation.LOCAL, recordingId);\n}","handlingStrategy":"retry","validationCode":"if (!archiveProxy.controlPublication().isConnected()) {\n    throw new IllegalStateException(\"archive control publication not connected\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    archive.extendRecording(channel, streamId, sourceLocation, recordingId);\n} catch (ArchiveException ex) {\n    if (ex.getMessage().contains(\"failed to send\")) { retryWithBackoff(); }\n}","preventionTips":["Verify recordingId exists before extending","Re-establish the control session after archive restarts","Limit concurrent control requests"],"tags":["aeron-archive","ipc","backpressure"],"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-15T23:17:13.987Z"}