hubcio commented on code in PR #4193:
URL: https://github.com/apache/iggy/pull/4193#discussion_r4016280293


##########
core/message_bus/src/client_listener/tcp_tls.rs:
##########
@@ -86,11 +82,7 @@ pub fn bind(
     // cannot enable it accidentally.
     cfg.max_early_data_size = 0;
 
-    let listener = bind_reusable_tcp_listener(addr)
-        .map_err(|_| IggyError::CannotBindToSocket(addr.to_string()))?;
-    let actual = listener
-        .local_addr()
-        .map_err(|e| IggyError::IoError(e.to_string()))?;
+    let (listener, actual) = bind_nodelay_listener(addr)?;

Review Comment:
   accepted WSS sockets already enable `TCP_NODELAY` before TLS. setting it on 
the listener would align startup error handling with TCP/TCP-TLS; normal WSS 
connections already disable nagle.



##########
core/message_bus/src/transports/tcp_tls.rs:
##########
@@ -218,7 +218,11 @@ impl TransportConn for TcpTlsTransportConn {
         let mut tls = match self.state {
             ConnState::Established(tls) => *tls,
             ConnState::Pending { stream, role } => {
-                match compio::time::timeout(handshake_grace, handshake(role, 
stream)).await {
+                let outcome = futures::select_biased! {
+                    () = ctx.shutdown.wait().fuse() => return,

Review Comment:
   this branch handles requested shutdown, so a warning would report normal 
cleanup as a failure. the installer still removes the connection state; a debug 
message is optional.



##########
core/message_bus/src/transports/wss.rs:
##########
@@ -174,12 +174,14 @@ impl TransportConn for WssTransportConn {
         // both inner handshake futures are large (rustls + tungstenite
         // state machines) and would otherwise push `run`'s state past
         // the `clippy::large_futures` threshold.
-        let tls_stream = match compio::time::timeout(
-            handshake_grace,
-            Box::pin(tls_handshake(role, self.stream)),
-        )
-        .await
-        {
+        let tls_outcome = futures::select_biased! {
+            () = ctx.shutdown.wait().fuse() => return,

Review Comment:
   both branches handle shutdown during connection setup, including after TLS 
completes. dropping the stream and cleaning the registry is intentional; a 
debug message is optional.



-- 
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]

Reply via email to