[
https://issues.apache.org/jira/browse/PROTON-1745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16329877#comment-16329877
]
Cliff Jansen commented on PROTON-1745:
--------------------------------------
Try the attached patch and see if that works. If so, we will need more input
as to whether the old/patched behavior should be mandatory, documented and
tested.
Looking at the code, both libuv and win_iocp work the same way as the patch.
For any proactor implementation, I believe that the addrinfo should be
available (or an error generated and never available) by the time a BOUND event
is provided on an incoming connection. So, no objection from me.
Note that this behavior is asymmetric with outgoing connections which may need
to configure some transport property early (SASL?) on BOUND before a final
address (and resulting socket) is successfully opened.
> [proton-c, regression] PN_CONNECTION_BOUND event is emitted too soon
> --------------------------------------------------------------------
>
> Key: PROTON-1745
> URL: https://issues.apache.org/jira/browse/PROTON-1745
> Project: Qpid Proton
> Issue Type: Bug
> Affects Versions: proton-c-0.20.0
> Environment: Fedora 27
> Reporter: Chuck Rolke
> Priority: Major
> Attachments: p1745_0.diff
>
>
> During a PN_CONNECTION_BOUND event proton socket information is not
> available. At PN_CONNECTION_REMOTE_OPEN the info is available.
> I instrumented an event loop in qpid-dispatch to log the event names as they
> are delivered and to log the result of creating a qd_connection rhost_port
> name. The source:
> {noformat}
> case PN_CONNECTION_BOUND:
> on_connection_bound(qd_server, e);
> // HACK ALERT
> pn_connection_t *pn_conn = pn_event_connection(e);
> qd_connection_t *qd_conn = pn_connection_get_context(pn_conn);
> set_rhost_port(pn_conn, qd_conn);
> qd_log(qd_server->log_source, QD_LOG_CRITICAL,
> "At end of connection bound the name is: %s",
> qd_connection_name(ctx));
> // END HACK ALERT
> break;
> case PN_CONNECTION_REMOTE_OPEN:
> {
> // HACK ALERT
> pn_connection_t *pn_conn = pn_event_connection(e);
> qd_connection_t *qd_conn = pn_connection_get_context(pn_conn);
> set_rhost_port(pn_conn, qd_conn);
> qd_log(qd_server->log_source, QD_LOG_CRITICAL,
> "At entry to remote open the name is: %s",
> qd_connection_name(ctx));
> /// END HACK ALERT
> {noformat}
>
> The log file shows:
> {noformat}
> 2018-01-17 12:38:35.224859 -0500 SERVER (critical) ***** handle sees event:
> PN_CONNECTION_INIT (/home/chug/git/qpid-dispatch/src/server.c:845)
> 2018-01-17 12:38:35.224868 -0500 SERVER (critical) ***** handle sees event:
> PN_CONNECTION_BOUND (/home/chug/git/qpid-dispatch/src/server.c:845)
> 2018-01-17 12:38:35.224890 -0500 SERVER (critical) At end of connection bound
> the name is: err: -6 (/home/chug/git/qpid-dispatch/src/server.c:887)
> 2018-01-17 12:38:35.224965 -0500 SERVER (critical) ***** handle sees event:
> PN_CONNECTION_REMOTE_OPEN (/home/chug/git/qpid-dispatch/src/server.c:845)
> 2018-01-17 12:38:35.224971 -0500 SERVER (critical) At entry to remote open
> the name is: 127.0.0.1:46722
> (/home/chug/git/qpid-dispatch/src/server.c:895){noformat}
> The "err -6" is a snoop on the return result of getnameinfo(): EAI_FAMILY
> 'ai_family' not supported. I suspect it's because the returned socket is junk.
> The code works correctly in 0.19.0, commit fe3c3
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]