aeron-io/aeron · error · AeronException
unexpected interrupt
Error message
unexpected interrupt
What it means
During AeronCluster.connect(), the blocking await helper rethrows checked exceptions and then checks the thread's interrupt flag. If the thread was interrupted while blocked, it throws AeronException('unexpected interrupt') because connect() does not support interruption and cannot complete safely with an unclear interruption state.
Solutions
- Avoid interrupting threads while AeronCluster.connect() is in flight; complete or cancel the connect before shutdown
- Run connect() on a thread not managed by the shutting-down executor, and close the cluster client via aeronCluster.close()
- If interruption is expected, catch AeronException around connect() and treat it as connect failure/cleanup
Example fix
// before executor.shutdownNow(); // interrupts in-flight connect() // after clusterClient.close(); // cancel connect/close first executor.shutdownNow();
Defensive patterns
Strategy: try-catch
Try / catch
try {
AeronCluster cluster = AeronCluster.connect(ctx);
} catch (AeronException e) {
if (Thread.currentThread().isInterrupted()) {
Thread.currentThread().interrupt(); // restore flag, treat as cancelled connect
return;
}
throw e;
} Prevention
- Do not call shutdownNow() on executors running AeronCluster.connect()
- Close cluster clients explicitly via aeronCluster.close() during shutdown
- Run connect() on a dedicated thread insulated from interrupt-based cancellation
When it happens
Trigger: Thread.interrupt() (or executor shutdownNow) hitting the thread inside AeronCluster.connect()'s busy-spin wait loop.
Common situations: Application shutdown calling executorService.shutdownNow() while a client thread is connecting; timeout watchdogs interrupting slow connects; container lifecycle hooks interrupting initialization.
Related errors
- unexpected interrupt
- unexpected interrupt
- Archive.Context.threadingMode(ArchiveThreadingMode.INVOKER)…
- unexpected Aeron close
- unexpected driver close
AI-assisted analysis of aeron-io/aeron@6d60124e15 (2026-09-12).
Data as JSON: /api/errors/467e04912d49597e.
Report an issue: GitHub.
Appendix: source
Thrown at aeron-cluster/src/main/java/io/aeron/cluster/client/AeronCluster.java:2349
" ingressEndpoints=" + ctx.ingressEndpoints() +
" ingressPublication=" + ingressPublication +
" egress.isConnected=" + isConnected +
" responseChannel=" + egressChannel);
for (final MemberIngress member : memberByIdMap.values())
{
if (null != member.publicationException)
{
ex.addSuppressed(member.publicationException);
}
}
throw ex;
}
if (Thread.currentThread().isInterrupted())
{
throw new AeronException("unexpected interrupt");
}
}
private void createEgressSubscription()
{
if (NULL_VALUE == egressRegistrationId)
{
egressRegistrationId = ctx.aeron().asyncAddSubscription(ctx.egressChannel(), ctx.egressStreamId());
}
try
{
egressSubscription = ctx.aeron().getSubscription(egressRegistrationId);
}
catch (final RegistrationException ex)
{
egressRegistrationId = NULL_VALUE;
View on GitHub (pinned to 6d60124e15)