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

Mqtt changes #660

Merged
merged 10 commits into from Oct 9, 2018
Merged

Mqtt changes #660

merged 10 commits into from Oct 9, 2018

Conversation

CIPop
Copy link
Member

@CIPop CIPop commented Oct 6, 2018

Checklist

  • I have read the contribution guidelines.
  • I added or modified the existing tests to cover the change (we do not allow our test coverage to go down).
  • This pull-request is submitted against the master branch.

Description of the changes

  • MQTT Transport Handlers got moved to use the ExecutorTaskScheduler from dotNetty.
  • ConcurrentObjectPool was replaced by a single multi-threaded event loop group
  • Cherrypicked items from the Provisioning PR:
    • Fixing Synchronous completions for AMQP.
    • Adding more AMQP tracing.

Reference/Link to the issue solved with this PR (if any)

Fixes #552

@CIPop CIPop self-assigned this Oct 6, 2018
@CIPop CIPop force-pushed the mqttChanges branch 2 times, most recently from d207270 to 24d2c19 Compare October 9, 2018 01:21
@CIPop
Copy link
Member Author

CIPop commented Oct 9, 2018

@CIPop CIPop merged commit 7022fe1 into Azure:master Oct 9, 2018
@@ -21,6 +21,11 @@ namespace Microsoft.Azure.Devices.Client.Transport.Mqtt
using Microsoft.Azure.Devices.Client.Extensions;
using System.Diagnostics;

//
// Note on ConfigureAwait: dotNetty is using a custom TaskScheduler that binds Tasks to the corresponding
// EventLoopGroup. To limit I/O to the EventLoopGroup and keep Netty semantics, we are going to ensure that the
Copy link
Member

Choose a reason for hiding this comment

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

replace EventLoopGroup with EventLoop

Copy link
Member Author

@CIPop CIPop Oct 15, 2018

Choose a reason for hiding this comment

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

Addressed in a personal branch that will be pushed soon for both DeviceClient and ProvisioningClient comments.

() => new MultithreadEventLoopGroup(eg => new SingleThreadEventLoop(eg, "MQTTExecutionThread", TimeSpan.FromSeconds(1)), 1),
TimeSpan.FromSeconds(5),
elg => elg.ShutdownGracefullyAsync());
private static MultithreadEventLoopGroup s_eventLoopGroup = new MultithreadEventLoopGroup();
Copy link
Member

Choose a reason for hiding this comment

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

Be aware that this will start Environment.ProcessorCount * 2 number of threads immediately. Not sure if there is a concern with this on smaller devices.

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'll leave it as-is for now: In a future SDK version we should expose the handler and the detailed configuration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added as comments.

@CIPop CIPop deleted the mqttChanges branch March 8, 2019 19:00
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.

AMQP Provisioning tests hanging
4 participants