{"record":{"id":"74a82bc29a912e30","repo":"aeron-io/aeron","slug":"failed-to-send-get-max-recorded-position-request","errorCode":null,"errorMessage":"failed to send get max recorded position request","messagePattern":"failed to send get max recorded position request","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java","lineNumber":1613,"sourceCode":"     * and for inactive recordings it will be the stop position.\n     *\n     * @param recordingId of the recording for which the position is required.\n     * @return the max recorded position of the recording.\n     * @since 1.44.0\n     */\n    public long getMaxRecordedPosition(final long recordingId)\n    {\n        lock.lock();\n        try\n        {\n            ensureConnected();\n            ensureNotReentrant();\n\n            lastCorrelationId = aeron.nextCorrelationId();\n\n            if (!archiveProxy.getMaxRecordedPosition(recordingId, lastCorrelationId, controlSessionId))\n            {\n                throw new ArchiveException(\"failed to send get max recorded position request\");\n            }\n\n            return pollForResponse(lastCorrelationId);\n        }\n        finally\n        {\n            lock.unlock();\n        }\n    }\n\n    /**\n     * Get the id of the Archive.\n     *\n     * @return the id of the Archive.\n     * @since 1.44.0\n     */\n    public long archiveId()\n    {","sourceCodeStart":1595,"sourceCodeEnd":1631,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L1595-L1631","documentation":"AeronArchive.getMaxRecordedPosition() throws this ArchiveException when the get-max-recorded-position request could not be offered to the archive control-request publication. archiveProxy.getMaxRecordedPosition() returned false because the publication is not connected, is closed, or remained back-pressured for the proxy's entire retry window, so pollForResponse never runs.","triggerScenarios":"Calling getMaxRecordedPosition(recordingId) when the archive control stream cannot accept the request: archive process down, control session expired/closed, control-request terminal buffer full, or misconfigured control channel.","commonSituations":"Replay progress trackers polling the max recorded position during archive restarts; long-lived clients with reaped sessions; burst polling that outpaces the archive's control-request draining.","solutions":["Confirm archive availability and matching control-channel configuration on client and archive.","Retry the call with backoff; transient back-pressure commonly resolves it.","Reconnect via AeronArchive.connect() if the control session has died.","Reduce polling frequency so the control publication does not back up.","Inspect archive logs for session timeouts or publication failures preceding this error."],"exampleFix":null,"handlingStrategy":"retry","validationCode":"if (!archive.archiveProxy().controlPublication().isConnected()) {\n    throw new IllegalStateException(\"archive control publication not connected\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    long max = archive.getMaxRecordedPosition(recordingId);\n} catch (ArchiveException e) {\n    if (e.getMessage().contains(\"failed to send get max recorded position request\")) {\n        Thread.sleep(backoffMs); // retry or reconnect\n    } else { throw e; }\n}","preventionTips":["Rate-limit replay-progress polling that reads max recorded position.","Verify archive reachability before each query burst.","Retry failed offers with backoff instead of aborting the workflow.","Recreate the archive session on session-timeout indicators."],"tags":["aeron-archive","backpressure","control-channel","position"],"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"}