TomPlanche commented on code in PR #4388:
URL: https://github.com/apache/iggy/pull/4388#discussion_r4184004783
##########
core/sdk/src/tcp/tcp_client.rs:
##########
@@ -225,6 +232,9 @@ impl BinaryTransport for TcpClient {
}
async fn send_raw_with_response(&self, code: u32, payload: Bytes) ->
Result<Bytes, IggyError> {
+ if self.disconnected_by_caller.load(Ordering::SeqCst) {
Review Comment:
Good catch, thanks :)
`connect_inner` now refuses with `NotConnected` while the flag is set, on
all three transports. Every reconnect goes through it, and the trait
`connect()` clears the flag first. A unit test per transport calls the inherent
`connect()` after an explicit `disconnect()` and checks that it is refused
without a dial. The tests fail without the check.
One window stays open: a `connect_inner` that already passed the check when
`disconnect()` runs can still finish, because the TCP `disconnect()` returns
early while a connect is in flight. That is problem 6 of #4287, so I left it
for its own PR.
--
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]