-
Notifications
You must be signed in to change notification settings - Fork 233
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
Conversation
03b7e2e
to
a8cad8e
Compare
@@ -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-"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be private?
There was a problem hiding this comment.
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
.../src/main/java/com/microsoft/azure/sdk/iot/device/transport/amqps/AmqpsIotHubConnection.java
Show resolved
Hide resolved
527c0fa
to
95aaa63
Compare
95aaa63
to
6b728fa
Compare
/azp run Java Canary |
Azure Pipelines successfully started running 1 pipeline(s). |
3666292
to
773d5e0
Compare
/azp run Java Canary |
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
773d5e0
to
7e190cc
Compare
/azp run |
Azure Pipelines successfully started running 5 pipeline(s). |
/azp run Java Canary |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Java Canary Basic |
/azp run Java Prod Basic |
Azure Pipelines successfully started running 1 pipeline(s). |
1 similar comment
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run SDL |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run Java Prod Basic |
Azure Pipelines successfully started running 1 pipeline(s). |
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