[ 
https://issues.apache.org/jira/browse/PROTON-2818?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17839869#comment-17839869
 ] 

ASF GitHub Bot commented on PROTON-2818:
----------------------------------------

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).





> Move epoll proctor connection logic to a task thread
> ----------------------------------------------------
>
>                 Key: PROTON-2818
>                 URL: https://issues.apache.org/jira/browse/PROTON-2818
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: proton-c-0.39.0
>            Reporter: Clifford Jansen
>            Assignee: Clifford Jansen
>            Priority: Major
>
> See PROTON-2812.  Implement the first described mitigation.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to