DanielLeens commented on issue #10528: URL: https://github.com/apache/seatunnel/issues/10528#issuecomment-4760501209
Thanks for the detailed write-up here. I checked the current implementation path in `SocketSourceReader`, and this does look like a real bug rather than an expected lifecycle edge case. The problematic part is that `pollNext()` creates the `BufferedReader` with try-with-resources around `socket.getInputStream()`. That means the reader is closed at the end of the method call, which also closes the underlying socket stream. Under normal reader lifecycle, the socket should stay owned by `open()` / `close()`, not by a single `pollNext()` invocation. So the fix direction you proposed is the right one: 1. keep the socket-backed reader as an instance-level resource 2. initialize it in `open()` 3. close it together with the socket in `close()` 4. keep `pollNext()` focused on reading and emitting records only This is worth keeping open as a real bug. We've labeled it as `help wanted`, so contributions are very welcome. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
