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
- Check the source machine's driver and archive logs for the underlying error matching the propagated message.
- Restart the source media driver / archive and re-issue the replication.
- Ensure the source Aeron client used for replication is dedicated and not closed while replication runs.
- 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
- Run the source Aeron media driver under supervision (systemd/daemontools) so a driver crash is restarted promptly.
- Do not close the source Archive client or its Aeron client while replication sessions are active.
- Poll pollForErrorResponse() on your own archive clients routinely to catch failures early.
- Keep driver resources (memory, file stores) healthy on the source host to avoid driver timeouts.
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
- Archive.Context.replicationChannel must be set
- failed to send replay request
- replication image closed unexpectedly
- (int)poller.relevantId()
- failed to send replicate request
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)