apache/seatunnel · warning · IllegalStateException
Interrupted during edge transport open
Error message
Interrupted during edge transport open
What it means
EdgeTransportClient.open ensures an authenticated session before sending; while doing so it may block (sleeping/backoff) and can be interrupted. On InterruptedException it restores the thread's interrupt flag and throws this IllegalStateException — the open was aborted because the calling thread was interrupted, not because of a network problem.
Source
Thrown at seatunnel-edge-agent/seatunnel-edge-agent-transport/src/main/java/org/apache/seatunnel/edge/agent/transport/socket/EdgeTransportClient.java:71
}
EdgeTransportClient(EdgeTransportConfig config, EdgeSocketSocketFactory socketFactory) {
this.config = Objects.requireNonNull(config, "config");
this.socketFactory = Objects.requireNonNull(socketFactory, "socketFactory");
this.lineTransport = new EdgeSocketLineTransport(config);
this.endpoint = EdgeTransportEndpoints.toSocketAddress(config.getEndpoint());
}
@Override
public void open() {
synchronized (connectionLock) {
try {
ensureAuthenticatedSession();
} catch (IOException ex) {
throw new UncheckedIOException(ex);
} catch (InterruptedException ex) {
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted during edge transport open", ex);
}
}
}
@Override
public void send(long batchId, String payload) throws IOException, InterruptedException {
sendUntilReceived(batchId, payload);
}
@Override
public void sendUntilReceived(long batchId, String payload)
throws IOException, InterruptedException {
synchronized (connectionLock) {
IOException lastIo = null;
InterruptedException lastInterrupted = null;
for (int cycle = 0; cycle < config.getMaxReconnectCycles(); cycle++) {
try {
ensureAuthenticatedSession();View on GitHub (pinned to cf67b549a7)
Solutions
- Investigate who interrupts the thread (shutdown/cancellation path) and ensure clients are closed before the executor shuts down
- Check the interrupt flag handling in your job lifecycle: stop scheduling sends after shutdown is initiated
- If interruption is expected (shutdown), catch IllegalStateException and treat open as aborted
- Retry opening the client on a fresh thread if the interruption was spurious
Example fix
// before executor.shutdownNow(); // interrupts in-flight open() // after client.close(); executor.shutdown(); executor.awaitTermination(30, TimeUnit.SECONDS);
Defensive patterns
Strategy: try-catch
Try / catch
try { client.open(); } catch (IllegalStateException e) { if (e.getMessage().contains("Interrupted")) { log.info("open aborted by interruption, not retrying"); return; } throw e; } Prevention
- Close clients and cancel in-flight opens before executor.shutdownNow()
- Check Thread.interrupted() status before starting long connect sequences
- Use cooperative shutdown (flags) instead of interrupts where possible
- Keep connect blocking time short so interrupts are rare
When it happens
Trigger: Another thread calls Thread.interrupt() on the thread inside EdgeTransportClient.open() while ensureAuthenticatedSession() is sleeping or retrying (e.g. job cancellation, shutdown hook, executor shutdownNow).
Common situations: Agent shutdown while a client is lazily connecting; a scheduled task cancelled mid-connect; thread pool shutdownNow() during deploy; watchdog interrupting a stuck connect.
Related errors
- The thread was interrupted while waiting for a fetcher task.
- Interrupted while closing python source reader
- DataTypeChanger not reset
- Handler not reset
- MDCContext is not activated
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/7977d7c689c2f3c8.
Report an issue: GitHub.