cliffjansen commented on code in PR #427: URL: https://github.com/apache/qpid-proton/pull/427#discussion_r1591276038
########## 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: Hopefully addressed in the reworked version. Agreed about the lifecycle state issue. This proposed fix strives for the minimal code logic changes to move the blocking activity to a different thread. The subsequent "real fix" for the parent JIRA will necessarily introduce a new state (presumably with early cancel option compared to the current blocked-until-done). The initiating of the getaddrinfo call will also presumably be sensibly moved back to the pn_xxx_connect call to avoid a pointless thread switch and the first_call boolean will have no purpose. -- 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