apache/seatunnel · warning
Failed to close edge socket server socket on {}:{}
Error message
Failed to close edge socket server socket on {}:{} What it means
Warned by closeServerSocketQuietly() when closing the server socket during the retry/open path throws an IOException. The method is intentionally 'quiet' — it logs and continues rather than propagating — typically while giving up on a partially opened socket between retries.
Source
Thrown at seatunnel-connectors-v2/connector-edge-socket/src/main/java/org/apache/seatunnel/connectors/seatunnel/edgesocket/source/EdgeSocketIngressServer.java:148
}
}
}
}
private void closeServerSocket() throws IOException {
ServerSocket current = serverSocket;
serverSocket = null;
if (current != null) {
current.close();
}
}
private void closeServerSocketQuietly() {
try {
closeServerSocket();
} catch (IOException e) {
log.warn(
"Failed to close edge socket server socket on {}:{}",
"0.0.0.0",
config.getPort(),
e);
}
}
private void receiveLoop() {
while (isReceiverActive()) {
try {
openServerSocketWithRetry();
if (!isReceiverActive()) {
return;
}
serveOneCollector();
} catch (SocketTimeoutException ignored) {
} catch (Exception e) {
if (shouldExitOnException(e)) {
return;View on GitHub (pinned to cf67b549a7)
Solutions
- Verify single ownership of the server socket — only one thread closes it.
- Check file-descriptor limits in the deployment environment (ulimit / container limits).
- Confirm the port is not contended by another process (address-already-in-use during the retry loop).
- Treat as benign if it follows a bind failure, but fix double-close if it appears during normal shutdown.
Example fix
// before
// close called from both stop() and openServerSocketWithRetry retry path
// after
if (serverSocket != null && !serverSocket.isClosed()) { serverSocket.close(); } Defensive patterns
Strategy: try-catch
Try / catch
try { server.start(); } catch (IOException e) { log.warn("server open failed; port state: {}", e.getMessage()); } // close failures after this are benign Prevention
- Close the server socket in exactly one place (a single owner/finally block)
- Check isClosed() before closing
- Raise fd limits in containers (ulimit -n) for high-churn sockets
When it happens
Trigger: closeServerSocket() throws IOException during closeServerSocketQuietly(), usually called from openServerSocketWithRetry() after a failed or superseded bind attempt.
Common situations: Socket already closed by the OS or another thread (double-close), port in a half-open state after bind failure, resource exhaustion in containers with low fd limits.
Related errors
- Failed to close ssh session
- Failed to close ssh client
- Failed to close ssh session
- Failed to close ssh client
- SOURCE_REOPEN_EXHAUSTED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/c8a20aab19edfec5.
Report an issue: GitHub.