{"record":{"id":"855aea870caa3b28","repo":"aeron-io/aeron","slug":"failed-to-send-get-stop-position-request","errorCode":null,"errorMessage":"failed to send get stop position request","messagePattern":"failed to send get stop position request","errorType":"exception","errorClass":"ArchiveException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java","lineNumber":1582,"sourceCode":"     * Get the stop position for a recording.\n     *\n     * @param recordingId of the recording for which the position is required.\n     * @return the stop position, or {@link #NULL_POSITION} if still active.\n     * @see #getRecordingPosition(long)\n     */\n    public long getStopPosition(final long recordingId)\n    {\n        lock.lock();\n        try\n        {\n            ensureConnected();\n            ensureNotReentrant();\n\n            lastCorrelationId = aeron.nextCorrelationId();\n\n            if (!archiveProxy.getStopPosition(recordingId, lastCorrelationId, controlSessionId))\n            {\n                throw new ArchiveException(\"failed to send get stop position request\");\n            }\n\n            return pollForResponse(lastCorrelationId);\n        }\n        finally\n        {\n            lock.unlock();\n        }\n    }\n\n    /**\n     * Get the max recorded position of a recording. For active recordings it will be the recording position,\n     * 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     */","sourceCodeStart":1564,"sourceCodeEnd":1600,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java#L1564-L1600","documentation":"AeronArchive.getStopPosition() throws this ArchiveException when the get-stop-position request could not be sent to the archive control-request publication. archiveProxy.getStopPosition() returned false, meaning the offer was rejected (not connected, publication closed, or buffer full throughout the retry window), so pollForResponse is never reached.","triggerScenarios":"Calling getStopPosition(recordingId) when the archive control publication cannot take the message: archive down or restarting, control session closed/timed out, control-request buffer saturated, or wrong control channel configuration.","commonSituations":"Determining recorded extent after a recording ends while the archive is being restarted; stale sessions on long-running clients; monitoring tooling that polls stop positions more aggressively than the control stream can drain.","solutions":["Verify the archive is up and control-channel endpoint/aeron.dir configuration matches on both sides.","Retry getStopPosition with backoff; transient back-pressure is the typical cause.","Re-establish the session via AeronArchive.connect() if the control session was terminated.","Throttle extent/position queries to avoid saturating the control publication.","Check archive logs for the session-close or publication error that preceded the failed offer."],"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 stop = archive.getStopPosition(recordingId);\n} catch (ArchiveException e) {\n    if (e.getMessage().contains(\"failed to send get stop position request\")) {\n        Thread.sleep(backoffMs); // retry or reconnect\n    } else { throw e; }\n}","preventionTips":["Check control-publication connectivity before querying recording extent.","Avoid aggressive polling loops that back up the control request buffer.","Retry transiently; most failed offers clear within the backoff window.","Monitor archive process health to catch restarts that break the session."],"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"}