qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF subversion and git services (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PROTON-1440) pn_connection_wake to return bool status
Date Sun, 19 Mar 2017 17:08:41 GMT

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

ASF subversion and git services commented on PROTON-1440:

Commit eb12513c51ae244a180ffee0819e6854774c4967 in qpid-proton's branch refs/heads/master
from [~aconway]
[ https://git-wip-us.apache.org/repos/asf?p=qpid-proton.git;h=eb12513 ]

PROTON-1440: libuv proactor - thread safe pn_connection_wake

This fix does not change the API but makes pn_connection_wake thread safe.

To be thread safe we need to a lock, so the pconnection_t attachment stays
on the pn_connection_t until the pn_connection_t is destroyed.

pn_proactor_free also was modified to run the normal socket close sequence
rather than a short-cut that just closes TCP sockets - this allows the
wake locking logic to run as normal, even if the application calls wake
after the proactor is freed.

> pn_connection_wake to return bool status
> ----------------------------------------
>                 Key: PROTON-1440
>                 URL: https://issues.apache.org/jira/browse/PROTON-1440
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-c
>    Affects Versions: 0.17.0
>            Reporter: Alan Conway
>            Assignee: Alan Conway
>             Fix For: 0.18.0
> pn_connection_wake() allows any thread to send a PN_CONNECTION_WAKE event to a proactor-managed
connection. Currently it does not return any value, and the application must ensure it is
not called after the PN_TRANSPORT_CLOSED event is processed for that connection.
> This is tricky for the application to synchronize and inconsistent with other pn_connection_
functions. If refcounts are used to keep a pn_connection_t in memory after the TRANSPORT_CLOSED,
then calling wake() is an error even though the pn_connection_t is valid.
> Change wake to be safe as long as the pn_connection_t is valid. It returns true if the
connection will be woken, false if it is too late.

This message was sent by Atlassian JIRA

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

View raw message