aeron-io/aeron · error · ArchiveException

failed to send get max recorded position request

Error message

failed to send get max recorded position request

What it means

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.

Solutions

  1. Confirm archive availability and matching control-channel configuration on client and archive.
  2. Retry the call with backoff; transient back-pressure commonly resolves it.
  3. Reconnect via AeronArchive.connect() if the control session has died.
  4. Reduce polling frequency so the control publication does not back up.
  5. Inspect archive logs for session timeouts or publication failures preceding this error.
Defensive patterns

Strategy: retry

Validate before calling

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

Try / catch

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

Prevention

When it happens

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

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

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/74a82bc29a912e30. Report an issue: GitHub.

Appendix: source

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

     * 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
     */
    public long getMaxRecordedPosition(final long recordingId)
    {
        lock.lock();
        try
        {
            ensureConnected();
            ensureNotReentrant();

            lastCorrelationId = aeron.nextCorrelationId();

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

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

    /**
     * Get the id of the Archive.
     *
     * @return the id of the Archive.
     * @since 1.44.0
     */
    public long archiveId()
    {

View on GitHub (pinned to 6d60124e15)