apache/seatunnel · info
Edge socket TCP server is already running, skip duplicate…
Error message
Edge socket TCP server is already running, skip duplicate start
What it means
Warned by EdgeSocketIngressServer.start() when the TCP server is asked to start while a receiver thread is already alive. The call is a no-op (idempotent) rather than throwing, preventing accidental double-binding of the port. It signals redundant lifecycle calls in caller code.
Solutions
- Guard caller code so start() is invoked once per server lifecycle, or rely on this idempotency and treat it as expected.
- Track started state in the owning component instead of calling start() unconditionally.
- In tests, stop the server in @AfterEach/tearDown before the next start().
Example fix
// before
server.start(); server.start(); // duplicate
// after
if (!server.isRunning()) { server.start(); } Defensive patterns
Strategy: type-guard
Validate before calling
if (!server.isReceiverAlive()) { server.start(); } Type guard
function canStart(server) { return typeof server.isReceiverAlive === 'function' && !server.isReceiverAlive(); } Prevention
- Own start/stop in one lifecycle component
- Treat start() as idempotent and this warning as expected if lifecycle can race
- In tests, always stop() in teardown
When it happens
Trigger: start() called twice without an intervening stop() — e.g. lifecycle start triggered again after a reopen/retry, or test/setup code invoking start() per-case without teardown.
Common situations: Source reader lifecycle hooks both initializing and starting the server, retry logic restarting the loop without recognizing it is still alive, tests with shared server instances.
Understand the failure class
Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.
Related errors
- BigtableSourceSplitEnumerator already closed; cannot create…
- BigtableSourceSplitEnumerator closed during client creation
- BUFFER_ADD_FAILED
- cluster: is not running, Please start the cluster first.
- DataTypeChanger not reset
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/76a9887423902270.
Report an issue: GitHub.
Appendix: source
Thrown at seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/source/EdgeSocketIngressServer.java:64
private final Object lifecycleLock = new Object();
private volatile ServerSocket serverSocket;
private volatile ExecutorService receiverExecutor;
private volatile Future<?> receiverFuture;
private volatile RuntimeException fatalReceiverException;
private volatile boolean hasActiveCollector;
private int remainingOpenRetries;
public EdgeSocketIngressServer(EdgeSocketConfig config, IncomingRecordHandler handler) {
this.config = config;
this.protocolHandler = new IngressProtocolHandler(config, handler);
}
/** Start the TCP server and begin accepting collector connections. */
public void start() {
synchronized (lifecycleLock) {
if (isReceiverAlive()) {
log.warn("Edge socket TCP server is already running, skip duplicate start");
return;
}
fatalReceiverException = null;
remainingOpenRetries = config.getMaxNumRetries();
startReceiverLoop();
}
}
/** Stop the TCP server and shut down the receiver thread. */
public void stop() throws IOException {
closeServerSocket();
synchronized (lifecycleLock) {
stopReceiverLoop();
}
}
public boolean isListening() {
ServerSocket ss = serverSocket;View on GitHub (pinned to cf67b549a7)