mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-20 13:31:28 +07:00
When EelProxy's `handleIncomingConnection` fails to establish the remote connection (e.g., remote debugger server not yet ready to accept connections), the local socket was left open, causing the client debugger to hang indefinitely waiting for data. The bug manifests in this scenario: 1. Proxy accepts incoming local connection (e.g., debugger connecting to forwarded port) 2. Proxy attempts to establish remote connection to target (e.g., Docker container) 3. Remote connection fails with `EelConnectionError` (target server not listening yet) 4. onConnectionError callback is invoked 5. BUT: `localSocket` remains open - never closed in error path 6. Client believes connection succeeded and blocks waiting for data 7. Connection only terminates after client-side timeout (minutes later) This creates "zombie" connections where the local client sees an established TCP connection but the proxy has no corresponding remote endpoint. The debugger appears to hang with no error message. The fix closes the local socket immediately on remote connection failure, matching OpenSSH's behavior where the client-side socket is closed as soon as remote port forwarding fails. This provides immediate connection failure feedback to the client. Any exception during socket closure is added as suppressed to preserve the original `EelConnectionError` diagnostics for troubleshooting. GitOrigin-RevId: 3d7027d3df31720c90b8e559b837efe8d22f13a3