astitcher commented on code in PR #427:
URL: https://github.com/apache/qpid-proton/pull/427#discussion_r1575402282


##########
c/src/proactor/epoll_raw_connection.c:
##########
@@ -413,6 +422,19 @@ pn_event_batch_t *pni_raw_connection_process(task_t *t, 
uint32_t io_events, bool
     }
     if (events & EPOLLOUT)
       praw_connection_connected_lh(rc);
+    if (rc->first_schedule) {
+      // Normal case: resumed logic from pn_proactor_raw_connect.
+      // But possible tie: pn_raw_connection_wake()
+      // Defer wake check until getaddrinfo is done.
+      rc->first_schedule = false;
+      assert(!events); // No socket yet.
+      praw_connection_first_connect_lh(rc);  // Drops and reacquires lock.
+      if (rc->psocket.epoll_io.fd != -1 && !pni_task_wake_pending(&rc->task)) {
+        unlock(&rc->task.mutex);
+        return NULL;
+      }
+    }

Review Comment:
   I wonder if this code should be the first piece of code in the 
possibilities, as it is the first that should happen; currently the logi cto 
kick off the connect is first; but now the logic to do the lookup must be 
earlier in the lifecycle of the connection so for clarity it should be the 
first condition in the sequence (unless the semantics mean that this doesn't 
work for some reason).



-- 
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: dev-unsubscr...@qpid.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to