aeron-io/aeron · error · ArchiveException

failed to send get stop position request

Error message

failed to send get stop position request

What it means

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.

Solutions

  1. Verify the archive is up and control-channel endpoint/aeron.dir configuration matches on both sides.
  2. Retry getStopPosition with backoff; transient back-pressure is the typical cause.
  3. Re-establish the session via AeronArchive.connect() if the control session was terminated.
  4. Throttle extent/position queries to avoid saturating the control publication.
  5. Check archive logs for the session-close or publication error that preceded the failed offer.
Defensive patterns

Strategy: retry

Validate before calling

if (!archive.archiveProxy().controlPublication().isConnected()) {
    throw new IllegalStateException("archive control publication not connected");
}

Try / catch

try {
    long stop = archive.getStopPosition(recordingId);
} catch (ArchiveException e) {
    if (e.getMessage().contains("failed to send get stop position request")) {
        Thread.sleep(backoffMs); // retry or reconnect
    } else { throw e; }
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "API request failed": what wrapped HTTP errors from external APIs mean and how to find the real cause — this error's family across 29 libraries.

Related errors


AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12). Data as JSON: /api/errors/855aea870caa3b28. Report an issue: GitHub.

Appendix: source

Thrown at aeron-archive/src/main/java/io/aeron/archive/client/AeronArchive.java:1582

     * Get the stop position for a recording.
     *
     * @param recordingId of the recording for which the position is required.
     * @return the stop position, or {@link #NULL_POSITION} if still active.
     * @see #getRecordingPosition(long)
     */
    public long getStopPosition(final long recordingId)
    {
        lock.lock();
        try
        {
            ensureConnected();
            ensureNotReentrant();

            lastCorrelationId = aeron.nextCorrelationId();

            if (!archiveProxy.getStopPosition(recordingId, lastCorrelationId, controlSessionId))
            {
                throw new ArchiveException("failed to send get stop position request");
            }

            return pollForResponse(lastCorrelationId);
        }
        finally
        {
            lock.unlock();
        }
    }

    /**
     * Get the max recorded position of a recording. For active recordings it will be the recording position,
     * and for inactive recordings it will be the stop position.
     *
     * @param recordingId of the recording for which the position is required.
     * @return the max recorded position of the recording.
     * @since 1.44.0
     */

View on GitHub (pinned to 6d60124e15)