matanper opened a new issue, #3482:
URL: https://github.com/apache/iggy/issues/3482
### Description
The Go TCP client (client/tcp) sets no deadlines anywhere in its network I/O
path. If a peer accepts the connection but then stops reading or never responds
— half-open connection, overloaded/wedged server, network black hole,
mid-stream stall — the calling goroutine blocks forever. There is no
configuration option to bound it.
### Affected area / component
Go SDK
### Proposed solution
Add configurable, functional-option timeouts stored on config and honored in
the I/O path:
1. replace `net.Dial("tcp", addr)` in connect() ([tcp_core.go:363]) with
`net.DialTimeout("tcp", addr, cfg.dialTimeout)`
2. in write() ([tcp_core.go:245]), call
`c.conn.SetWriteDeadline(time.Now().Add(cfg.writeTimeout))` before the write
loop.
3. in read() ([tcp_core.go:229]), call
`c.conn.SetReadDeadline(time.Now().Add(cfg.readTimeout))` before the read loop.
Defaults can stay 0 (no timeout) for back-compat, as long as the knobs exist.
### Alternatives considered
_No response_
### Contribution
- [x] I'm willing to submit a pull request to implement this feature
### Good first issue
- [ ] I think this could be a good first issue for a new contributor
--
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]