Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where amqp stack opened links on non reactor threads #560

Merged
merged 3 commits into from
Aug 6, 2019

Conversation

timtay-microsoft
Copy link
Member

@timtay-microsoft timtay-microsoft commented Jul 22, 2019

Reactor operations are not thread safe, and need to be done on a reactor exposed thread. This PR fixes the device client so that it no longer does any reactor operations on a non-reactor thread.

Benefits include fixing an issue where calling open on an AMQP device client often failed. Now open is significantly more consistent.

Miscellaneous fixes in this PR include fixing reconnection logic in AMQP to work regardless of if client is multiplexing, subscribed to twin, subscribed to methods, etc.

Also removing openClientWithRetry logic now, since AMQP stack now should be relied on to open a connection without retry

@timtay-microsoft timtay-microsoft force-pushed the amqpFix branch 5 times, most recently from 03b7e2e to a8cad8e Compare July 30, 2019 15:11
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@Azure Azure deleted a comment from azure-pipelines bot Jul 30, 2019
@@ -26,8 +26,8 @@
public static final String SENDER_LINK_ENDPOINT_PATH = "$cbs";
public static final String RECEIVER_LINK_ENDPOINT_PATH = "$cbs";

private static final String SENDER_LINK_TAG_PREFIX = "cbs-sender-";
private static final String RECEIVER_LINK_TAG_PREFIX = "cbs-receiver-";
public static final String SENDER_LINK_TAG_PREFIX = "cbs-sender-";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is changing of scope required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working on a refactor where this can stay private

* @return true
*/
@Override
public Boolean operationLinksOpened()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be private?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but it can be package private. I'll edit it

@timtay-microsoft
Copy link
Member Author

/azp run Java Canary

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run Java Canary

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

-Fix links not being opened on a reactor thread (proton-j race condition)
-Fix latching logic to prevent connections from being reported open before all links have been opened
-Improved reliability of open() calls
@timtay-microsoft
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 5 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run Java Canary

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run Java Canary Basic

@timtay-microsoft
Copy link
Member Author

/azp run Java Prod Basic

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

1 similar comment
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run SDL

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@timtay-microsoft
Copy link
Member Author

/azp run Java Prod Basic

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants