aeron-io/aeron · error · ArchiveException

srcArchive.pollForErrorResponse()

Error message

srcArchive.pollForErrorResponse()

What it means

ReplicationSession periodically polls the source archive client for an error response (srcArchive.pollForErrorResponse()); if the source Aeron client/archive reports any error, its message is rethrown as an ArchiveException on the destination side, aborting replication. This surfaces source-side client failures (e.g. driver errors, failed control requests) so replication does not hang while the source is broken.

Solutions

  1. Check the source machine's driver and archive logs for the underlying error matching the propagated message.
  2. Restart the source media driver / archive and re-issue the replication.
  3. Ensure the source Aeron client used for replication is dedicated and not closed while replication runs.
  4. Monitor both drivers' health (aeronstat / driver heartbeat) to detect source-side failure before replication stalls.

Example fix

// before
final long replicationId = dstArchive.replication(srcRecordingId, channel); // assumes source stays healthy
// after
if (!srcArchive.isClosed() && srcArchive.pollForErrorResponse() == null) {
    final long replicationId = dstArchive.replication(srcRecordingId, channel);
} else {
    log.error("source archive client in error state; fix source before replicating");
}
Defensive patterns

Strategy: try-catch

Validate before calling

// Ensure the source archive client has no pending error before relying on it:
String err = sourceArchive.pollForErrorResponse();
if (err != null) throw new IllegalStateException("source archive client in error state: " + err);

Try / catch

try {
    replicationId = archive.replication(srcRecordingId, channel);
} catch (ArchiverException e) {
    // message is the source client's error text
    log.error("replication aborted due to source client error: " + e.getMessage());
    restartSourceAndReplicate(srcRecordingId, channel);
}

Prevention

When it happens

Trigger: The source Archive client's underlying Aeron client or control requests enter an error state — e.g. the media driver dies, a control request fails, or the archive client records an error — and the periodic pollForErrorResponse check in checkSourceArchiveErrors/progress path (ReplicationSession.java:998) observes the non-null error message.

Common situations: Source Aeron driver terminated or crashed during replication; source archive client's control channel failed; driver timeout on the source host; shared driver shutdown taking the archive client down.

Related errors


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

Appendix: source

Thrown at aeron-archive/src/main/java/io/aeron/archive/ReplicationSession.java:998

            null == reason ? "" : reason);
        state = newState;
        activeCorrelationId = NULL_VALUE;
        timeOfLastActionMs = epochClock.time();
    }

    private void pollSourceArchiveEvents()
    {
        if (null != srcArchive && State.DONE != state && NULL_VALUE == activeCorrelationId)
        {
            final long nowMs = epochClock.time();
            if (nowMs > (timeOfLastScheduledSourceArchivePollMs + SOURCE_ARCHIVE_POLL_INTERVAL_MS))
            {
                timeOfLastScheduledSourceArchivePollMs = nowMs;

                final String errorMessage = srcArchive.pollForErrorResponse();
                if (null != errorMessage)
                {
                    throw new ArchiveException(errorMessage);
                }
            }
        }
    }

    private void logStateChange(
        final State oldState,
        final State newState,
        final long replicationId,
        final long srcRecordingId,
        final long dstRecordingId,
        final long position,
        final String reason)
    {
        ArchiveTracing.traceReplicationSessionStateChange(
            oldState, newState, replicationId, srcRecordingId, dstRecordingId, position, reason);
    }

View on GitHub (pinned to 6d60124e15)