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(azure-iot-device-amqp): 🐛 multiple AMQP links were being created for telemetry #966

Merged
merged 8 commits into from
May 26, 2021
Merged

fix(azure-iot-device-amqp): 🐛 multiple AMQP links were being created for telemetry #966

merged 8 commits into from
May 26, 2021

Conversation

vishnureddy17
Copy link
Member

close #965
close #957

@vishnureddy17
Copy link
Member Author

/azp run node-canary

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

debug('using existing d2c link');
this._d2cLink.send(amqpMessage, handleResult('AMQP Transport: Could not send', sendCallback));
} else {
debug('waiting for a D2C link');
Copy link
Contributor

Choose a reason for hiding this comment

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

Tell the story here in a comment.

}
});
} else {
if (this._d2cLink) {
Copy link
Contributor

Choose a reason for hiding this comment

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

You're going to have to add unit tests simply to keep our coverage numbers up AND, this should have some tests anyway.

Copy link
Contributor

@anthonyvercolano anthonyvercolano left a comment

Choose a reason for hiding this comment

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

Touch base with me on if you are having an issue creating unit tests.

@vishnureddy17
Copy link
Member Author

/azp run node-canary

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

if (this._c2dLink) {
debug('C2D link already attached, doing nothing....');
process.nextTick(callback);
} else if (this._c2dLinkAttaching) {
Copy link
Contributor

@anthonyvercolano anthonyvercolano May 19, 2021

Choose a reason for hiding this comment

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

I think you face an issue that in the time betwwen starting to attach the c2d link and it's completion

  1. you get a new enable.
  2. you go ahead and on the next tick invoke the callback for the second enable which gives the implication that c2d is enabled when it's not.
  3. the actual enable then finishes 20 ticks later

Honestly, I think your solution to the send problem was pretty darn good. Can you use it here? If you can, you would then be for the most part be repeating code. Time to put enabling code into a function at that point? Darn booleans. Can't trust them.

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 see it. Good catch.

@anthonyvercolano
Copy link
Contributor

Looks good. We'll have to fix the gate though

@vishnureddy17
Copy link
Member Author

/azp run horton-node-gate

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vishnureddy17
Copy link
Member Author

/azp run horton-node-gate

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vishnureddy17 vishnureddy17 merged commit fa05d64 into Azure:master May 26, 2021
@vishnureddy17 vishnureddy17 deleted the amqp-fix-extra-links branch May 26, 2021 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants