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

DeviceClient.close method may stuck when the connection has been lost inside the Connection handler #1110

Closed
riwaida opened this issue Feb 28, 2022 · 6 comments
Assignees
Labels
bug fix checked in investigation-required IoTSDK tracks all IoT SDK issues across the board

Comments

@riwaida
Copy link

riwaida commented Feb 28, 2022

Context

  • OS and version used: Windows 10, 11
  • Node.js version: v16.13.1
  • npm version: 8.1.2
  • list of installed packages: azure-iot-device-mqtt@1.15.8, azure-iot-device@1.17.8, jshint@2.13.3, moment@2.29.1
  • cloned repo:

Description of the issue

When I call DeviceClient.close with await operator in the Error handler, the close method does not returned and may stuck application. As far as my investigation, the issue happens when network connection has been lost before sending message inside Connection handler.
The issue is happening intermittently in the actual app. I am not sure how the issue was happened in the production scenario. But we could reproduce the problem with simple app on the debugger with instruction below.
Also, I confirmed that the issue happens only mqtt over websocket.

  1. Set a breakpoint at the entry point of sendMessage function in the sample code below.
  2. Execute the sample with debugger.
  3. Once you getting break into the debugger at the breakpoint, disconnects ethernet cable.
  4. After disconnected the cable, continure to run the sample.
  5. Few seconds later, errorHandler function will be called, and it invokes close method.
    Expected result: close method can be returned immediately.
    Actual result: close method does not returned forever and application stops running.

Code sample exhibiting the issue

'use strict';

const Protocol = require('azure-iot-device-mqtt').MqttWs;
const Client = require('azure-iot-device').Client;
const Message = require('azure-iot-device').Message;

const deviceConnectionString = process.env.IOTHUB_DEVICE_CONNECTION_STRING;
let sendInterval = 0;

function connectHandler () {
  console.log('+Client connected');
  if (!sendInterval) {
    sendMessage();
    // const time = 5 * 1000;
    // sendInterval = setInterval(sendMessage, time);
  }
  console.log('-Client connected');
}

function disconnectHandler () {
  console.log('+Client disconnected');
  client.open().catch((err) => {
    console.error(err.message);
  });
  console.log('-Client disconnected');
}

function messageHandler (msg) {
  console.log('+Client onMessage');
  console.log('Id: ' + msg.messageId + ' Body: ' + msg.data);
  client.complete(msg, printResultFor('completed'));
  console.log('-Client onMessage');
}

async function errorHandler (err) {
  console.log('+Client error');
  console.error(err.message);
  console.log('calling DeviceClient.close()');
  await client.close();
  console.log('returned from DeviceClient.closed');
  console.log('-Client error');
}

function sendMessage() {
  // SET A BREAKPOINT AT HERE.
  // ONCE YOU GET BREAK INTO THE DEBUGGER. DISCONNECT NETWORK CABLE AND GO.
  console.log('Please unplug network cable from your device to simulate disconnection');
  const message = generateMessage();
  console.log('Sending message: ' + message.getData());
  client.sendEvent(message, printResultFor('send'));
}

function generateMessage () {
  const windSpeed = 10 + (Math.random() * 4); // range: [10, 14]
  const temperature = 20 + (Math.random() * 10); // range: [20, 30]
  const humidity = 60 + (Math.random() * 20); // range: [60, 80]
  const data = JSON.stringify({ deviceId: 'myFirstDevice', windSpeed: windSpeed, temperature: temperature, humidity: humidity });
  const message = new Message(data);
  message.properties.add('temperatureAlert', (temperature > 28) ? 'true' : 'false');
  return message;
}

// fromConnectionString must specify a transport constructor, coming from any transport package.
let client = Client.fromConnectionString(deviceConnectionString, Protocol);

client.on('connect', connectHandler);
client.on('error', errorHandler);
client.on('disconnect', disconnectHandler);
client.on('message', messageHandler);

client.open()
.catch(err => {
  console.error('Could not connect: ' + err.message);
});


// Helper function to print results in the console
function printResultFor(op) {
  return async function printResult(err, res) {
    if (err) console.log(op + ' status: ' + err.constructor.name);
    if (res) console.log(op + ' status: ' + res.constructor.name);
  };
}

Console log of the issue

repro> node .\simple_sample_device.js
Debugger attached.
  azure-iot-mqtt-base:MqttBase In MQTT base FSM - entered onEnter for disconnect +0ms
  azure-iot-device:DeviceClient in newListener, enabling C2D. +0ms
  azure-iot-device:DeviceClient enabling C2D +1ms
  azure-iot-common:RetryOperation _enableC2D:0:ExponentialBackOffWithJitter Operation started at 1646030844755 - Will stop retrying after: 1646031084755 +0ms
  azure-iot-device-mqtt:Mqtt disconnected -> connecting (disconnected.connect) +0ms
  azure-iot-device-mqtt:Mqtt topic publish: devices/test0124/messages/events/ +3ms
  azure-iot-device-mqtt:Mqtt message topic subscribe: devices/test0124/messages/devicebound/# +1ms
  azure-iot-mqtt-base:MqttBase disconnected -> connecting (disconnected.connect) +11ms
  azure-iot-mqtt-base:MqttBase username: riwaida-iothub-002.azure-devices.net/test0124/?api-version=2021-04-12&DeviceClientType=azure-iot-device%2F1.17.8%20(node%20v16.13.1%3B%20Windows_NT%2010.0.22000%3B%20x64) +1ms
  azure-iot-mqtt-base:MqttBase uri:      wss://riwaida-iothub-002.azure-devices.net:443/$iothub/websocket +0ms
  mqttjs connecting to an MQTT broker... +0ms
  mqttjs:client MqttClient :: options.protocol wss +0ms
  mqttjs:client MqttClient :: options.protocolVersion 4 +0ms
  mqttjs:client MqttClient :: options.username riwaida-iothub-002.azure-devices.net/test0124/?api-version=2021-04-12&DeviceClientType=azure-iot-device%2F1.17.8%20(node%20v16.13.1%3B%20Windows_NT%2010.0.22000%3B%20x64) +1ms
  mqttjs:client MqttClient :: options.keepalive 180 +0ms
  mqttjs:client MqttClient :: options.reconnectPeriod 0 +1ms
  mqttjs:client MqttClient :: options.rejectUnauthorized true +0ms
  mqttjs:client MqttClient :: options.topicAliasMaximum undefined +0ms
  mqttjs:client MqttClient :: clientId test0124 +0ms
  mqttjs:client MqttClient :: setting up stream +1ms
  mqtt-packet:parser _resetState: resetting packet, error, _list, and _stateCounter +0ms
  mqttjs:client _setupStream :: calling method to clear reconnect +3ms
  mqttjs:client _clearReconnect : clearing reconnect timer +1ms
  mqttjs:client _setupStream :: using streamBuilder provided to client to create stream +0ms
  mqttjs calling streambuilder for wss +11ms
  mqttjs:ws streamBuilder +0ms
  mqttjs:ws createWebSocket +0ms
  mqttjs:ws protocol: MQTT 4 +1ms
  mqttjs:ws creating new Websocket for url: wss://riwaida-iothub-002.azure-devices.net:443/$iothub/websocket and protocol: mqtt +0ms
  mqttjs:client _setupStream :: pipe stream to writable stream +43ms
  mqttjs:client _setupStream: sending packet `connect` +2ms
  mqttjs:client sendPacket :: packet: { cmd: 'connect' } +1ms
  mqttjs:client sendPacket :: emitting `packetsend` +3ms
  mqttjs:client sendPacket :: writing to stream +1ms
  mqtt-packet:writeToStream generate called +0ms
  mqtt-packet:writeToStream generate: packet.cmd: connect +28ms
  mqtt-packet:writeToStream writeVarByteInt: writing to stream: <Buffer db 02> +5ms
  mqtt-packet:writeToStream writeNumberCached: number: 4 +3ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 04> +0ms
  mqtt-packet:writeToStream writeString: MQTT +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 180 +1ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 b4> +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 8 +1ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 08> +0ms
  mqtt-packet:writeToStream writeString: test0124 +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 170 +1ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 aa> +0ms
  mqtt-packet:writeToStream writeString: riwaida-iothub-002.azure-devices.net/test0124/?api-version=2021-04-12&DeviceClientType=azure-iot-device%2F1.17.8%20(node%20v16.13.1%3B%20Windows_NT%2010.0.22000%3B%20x64) +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 153 +0ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 99> +0ms
  mqtt-packet:writeToStream writeString: SharedAccessSignature ************************************** +1ms
  mqttjs:client sendPacket :: writeToStream result true +46ms
  azure-iot-common:RetryOperation open:1:ExponentialBackOffWithJitter Operation started at 1646030844870 - Will stop retrying after: 1646031084870 +115ms
  mqttjs:client writable stream :: parsing buffer +116ms
  mqtt-packet:parser parse: current state: _parseHeader +216ms
  mqtt-packet:parser _parseHeader: packet: Packet { cmd: 'connack', retain: false, qos: 0, dup: false, length: -1, topic: null, payload: null } +1ms
  mqtt-packet:parser parse: state complete. _stateCounter is now: 1 +1ms
  mqtt-packet:parser parse: packet.length: -1, buffer list length: 3 +0ms
  mqtt-packet:parser _parseVarByteNum +0ms
  mqtt-packet:parser _parseVarByteNum: result: { bytes: 1, value: 2 } +1ms
  mqtt-packet:parser _parseLength 2 +0ms
  mqtt-packet:parser parse: state complete. _stateCounter is now: 2 +0ms
  mqtt-packet:parser parse: packet.length: 2, buffer list length: 2 +0ms
  mqtt-packet:parser _parsePayload: payload BufferListStream {
  mqtt-packet:parser   _bufs: [ <Buffer 01 00> ],
  mqtt-packet:parser   length: 2,
  mqtt-packet:parser   _readableState: ReadableState {
  mqtt-packet:parser     objectMode: false,
  mqtt-packet:parser     highWaterMark: 16384,
  mqtt-packet:parser     buffer: BufferList { head: null, tail: null, length: 0 },
  mqtt-packet:parser     length: 0,
  mqtt-packet:parser     pipes: null,
  mqtt-packet:parser     pipesCount: 0,
  mqtt-packet:parser     flowing: null,
  mqtt-packet:parser     ended: false,
  mqtt-packet:parser     endEmitted: false,
  mqtt-packet:parser     reading: false,
  mqtt-packet:parser     sync: true,
  mqtt-packet:parser     needReadable: false,
  mqtt-packet:parser     emittedReadable: false,
  mqtt-packet:parser     readableListening: false,
  mqtt-packet:parser     resumeScheduled: false,
  mqtt-packet:parser     paused: true,
  mqtt-packet:parser     emitClose: true,
  mqtt-packet:parser     autoDestroy: false,
  mqtt-packet:parser     destroyed: false,
  mqtt-packet:parser     defaultEncoding: 'utf8',
  mqtt-packet:parser     awaitDrain: 0,
  mqtt-packet:parser     readingMore: false,
  mqtt-packet:parser     decoder: null,
  mqtt-packet:parser     encoding: null
  mqtt-packet:parser   },
  mqtt-packet:parser   readable: true,
  mqtt-packet:parser   _events: [Object: null prototype] {},
  mqtt-packet:parser   _eventsCount: 0,
  mqtt-packet:parser   _maxListeners: undefined,
  mqtt-packet:parser   _writableState: WritableState {
  mqtt-packet:parser     objectMode: false,
  mqtt-packet:parser     highWaterMark: 16384,
  mqtt-packet:parser     finalCalled: false,
  mqtt-packet:parser     needDrain: false,
  mqtt-packet:parser     ending: false,
  mqtt-packet:parser     ended: false,
  mqtt-packet:parser     finished: false,
  mqtt-packet:parser     destroyed: false,
  mqtt-packet:parser     decodeStrings: true,
  mqtt-packet:parser     defaultEncoding: 'utf8',
  mqtt-packet:parser     length: 0,
  mqtt-packet:parser     writing: false,
  mqtt-packet:parser     corked: 0,
  mqtt-packet:parser     sync: true,
  mqtt-packet:parser     bufferProcessing: false,
  mqtt-packet:parser     onwrite: [Function (anonymous)],
  mqtt-packet:parser     writecb: null,
  mqtt-packet:parser     writelen: 0,
  mqtt-packet:parser     bufferedRequest: null,
  mqtt-packet:parser     lastBufferedRequest: null,
  mqtt-packet:parser     pendingcb: 0,
  mqtt-packet:parser     prefinished: false,
  mqtt-packet:parser     errorEmitted: false,
  mqtt-packet:parser     emitClose: true,
  mqtt-packet:parser     autoDestroy: false,
  mqtt-packet:parser     bufferedRequestCount: 0,
  mqtt-packet:parser     corkedRequestsFree: CorkedRequest {
  mqtt-packet:parser       next: null,
  mqtt-packet:parser       entry: null,
  mqtt-packet:parser       finish: [Function (anonymous)]
  mqtt-packet:parser     }
  mqtt-packet:parser   },
  mqtt-packet:parser   writable: true,
  mqtt-packet:parser   allowHalfOpen: true,
  mqtt-packet:parser   [Symbol(kCapture)]: false
  mqtt-packet:parser } +1ms
  mqtt-packet:parser _parseConnack +11ms
  mqtt-packet:parser _parseConnack: complete +0ms
  mqtt-packet:parser _parsePayload complete result: true +0ms
  mqtt-packet:parser parse: state complete. _stateCounter is now: 3 +1ms
  mqtt-packet:parser parse: packet.length: 2, buffer list length: 2 +0ms
  mqtt-packet:parser _newPacket +0ms
  mqtt-packet:parser _newPacket: parser emit packet: packet.cmd: connack, packet.payload: null, packet.length: 2 +0ms
  mqttjs:client parser :: on packet push to packets array. +18ms
  mqtt-packet:parser _newPacket: new packet +2ms
  mqtt-packet:parser parse: state complete. _stateCounter is now: 4 +1ms
  mqtt-packet:parser parse: packet.length: -1, buffer list length: 0 +0ms
  mqtt-packet:parser parse: exited while loop. packet: -1, buffer list length: 0 +0ms
  mqttjs:client work :: getting next packet in queue +2ms
  mqttjs:client work :: packet pulled from queue +0ms
  mqttjs:client _handlePacket :: emitting packetreceive +1ms
  mqttjs:client _handleConnack +0ms
  mqttjs:client _setupPingTimer :: keepalive 180 (seconds) +1ms
  mqttjs:client connect :: sending queued packets +4ms
  mqttjs:client deliver :: entry undefined +1ms
  mqttjs:client _resubscribe +1ms
  azure-iot-mqtt-base:MqttBase Device is connected +251ms
  azure-iot-mqtt-base:MqttBase CONNACK: {"cmd":"connack","retain":false,"qos":0,"dup":false,"length":2,"topic":null,"payload":null,"sessionPresent":true,"returnCode":0} +1ms
  azure-iot-mqtt-base:MqttBase connecting -> connected () +0ms
  azure-iot-device-mqtt:Mqtt connect +255ms
  azure-iot-device-mqtt:Mqtt connecting -> connected () +0ms
+Client connected
Please unplug network cable from your device to simulate disconnection
Sending message: {"deviceId":"myFirstDevice","windSpeed":12.651429463014113,"temperature":27.235951562636373,"humidity":76.58971969815708}
  azure-iot-common:RetryOperation sendEvent:2:ExponentialBackOffWithJitter Operation started at 1646030852550 - Will stop retrying after: 1646031092550 +8s
  azure-iot-device-mqtt:Mqtt Invoking sendEvent handler in the device client FSM{"data":"{\"deviceId\":\"myFirstDevice\",\"windSpeed\":12.651429463014113,\"temperature\":27.235951562636373,\"humidity\":76.58971969815708}","properties":{"propertyList":[{"key":"temperatureAlert","value":"false"}]},"messageId":"","to":"","lockToken":"","correlationId":"","userId":""} +8s
  mqttjs:client publish :: message `{"deviceId":"myFirstDevice","windSpeed":12.651429463014113,"temperature":27.235951562636373,"humidity":76.58971969815708}` to topic `devices/test0124/messages/events/temperatureAlert=false` +8s
  mqttjs:client publish :: qos 1 +1ms
  mqttjs:client MqttClient:publish: packet cmd: publish +0ms
  mqttjs:client _sendPacket :: (test0124) ::  start +1ms
  mqttjs:client storeAndSend :: store packet with cmd publish to outgoingStore +0ms
  mqttjs:client nop :: undefined +1ms
  mqttjs:client sendPacket :: packet: {
  mqttjs:client   cmd: 'publish',
  mqttjs:client   topic: 'devices/test0124/messages/events/temperatureAlert=false',
  mqttjs:client   payload: '{"deviceId":"myFirstDevice","windSpeed":12.651429463014113,"temperature":27.235951562636373,"humidity":76.58971969815708}',
  mqttjs:client   qos: 1,
  mqttjs:client   retain: false,
  mqttjs:client   messageId: 3413,
  mqttjs:client   dup: false
  mqttjs:client } +0ms
  mqttjs:client sendPacket :: emitting `packetsend` +2ms
  mqttjs:client sendPacket :: writing to stream +1ms
  mqtt-packet:writeToStream generate called +8s
  mqtt-packet:writeToStream generate: packet.cmd: publish +1ms
  mqtt-packet:writeToStream publish: packet: { cmd: 'publish', topic: 'devices/test0124/messages/events/temperatureAlert=false', payload: '{"deviceId":"myFirstDevice","windSpeed":12.651429463014113,"temperature":27.235951562636373,"humidity":76.58971969815708}', qos: 1, retain: false, messageId: 3413, dup: false } +1ms
  mqtt-packet:writeToStream writeVarByteInt: writing to stream: <Buffer b4 01> +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 55 +0ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 37> +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 3413 +0ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 0d 55> +1ms
  mqtt-packet:writeToStream publish: payload: '{"deviceId":"myFirstDevice","windSpeed":12.651429463014113,"temperature":27.235951562636373,"humidity":76.58971969815708}' +0ms
  mqttjs:client sendPacket :: writeToStream result true +6ms
  mqttjs:client sendPacket :: invoking cb +0ms
  mqttjs:client nop :: undefined +0ms
  mqttjs:client _sendPacket :: (test0124) ::  end +0ms
-Client connected
  azure-iot-device-mqtt:Mqtt subscribe: {"name":"devices/test0124/messages/devicebound/#","subscribeInProgress":false,"subscribed":false,"topicMatchRegex":{}} +16ms
  mqttjs:client subscribe: array topic devices/test0124/messages/devicebound/# +3ms
  mqttjs:client subscribe: pushing topic `devices/test0124/messages/devicebound/#` and qos `1` to subs list +0ms
  mqttjs:client subscribe :: resubscribe true +1ms
  mqttjs:client subscribe :: call _sendPacket +0ms
  mqttjs:client _sendPacket :: (test0124) ::  start +0ms
  mqttjs:client sendPacket :: packet: {
  mqttjs:client   cmd: 'subscribe',
  mqttjs:client   subscriptions: [ { topic: 'devices/test0124/messages/devicebound/#', qos: 1 } ],
  mqttjs:client   qos: 1,
  mqttjs:client   retain: false,
  mqttjs:client   dup: false,
  mqttjs:client   messageId: 3414
  mqttjs:client } +1ms
  mqttjs:client sendPacket :: emitting `packetsend` +1ms
  mqttjs:client sendPacket :: writing to stream +0ms
  mqtt-packet:writeToStream generate called +7ms
  mqtt-packet:writeToStream generate: packet.cmd: subscribe +1ms
  mqtt-packet:writeToStream subscribe: packet:  +0ms
  mqtt-packet:writeToStream subscribe: writing to stream: [ [ [ <Buffer 80>, <Buffer 81> ], [ <Buffer 88>, <Buffer 89> ] ], [ [ <Buffer 82>, <Buffer 83> ], [ <Buffer 8a>, <Buffer 8b> ] ], [ [ <Buffer 84>, <Buffer 85> ], [ <Buffer 8c>, <Buffer 8d> ] ] ] +1ms
  mqtt-packet:writeToStream writeVarByteInt: writing to stream: <Buffer 2c> +1ms
  mqtt-packet:writeToStream writeNumberCached: number: 3414 +0ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 0d 56> +0ms
  mqtt-packet:writeToStream writeNumberCached: number: 39 +0ms
  mqtt-packet:writeToStream writeNumberCached: <Buffer 00 27> +1ms
  mqtt-packet:writeToStream writeString: devices/test0124/messages/devicebound/# +0ms
  mqttjs:client sendPacket :: writeToStream result true +4ms
  mqttjs:client sendPacket :: invoking cb +1ms
  mqttjs:client nop :: undefined +0ms
  azure-iot-common:RetryOperation open:1 Complete +26ms
  mqttjs:client (test0124)stream :: on close +19s
  mqttjs:client flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function +1ms
  azure-iot-common:RetryOperation:Errors _enableC2D:0 Error: Error: Connection closed is not retriable +0ms
  azure-iot-device:DeviceClient:Errors Error while enabling C2D: Error: Connection closed +0ms
  azure-iot-device:DeviceClient:Errors in newListener, error enabling C2D: Error: Connection closed +1ms
+Client error
Connection closed
calling DeviceClient.close()
  azure-iot-device-mqtt:Mqtt connected -> disconnecting (connected.disconnect) +35s
  azure-iot-mqtt-base:MqttBase connected -> disconnecting (connected.disconnect) +42s
  azure-iot-mqtt-base:MqttBase removing all listeners +1ms
  azure-iot-mqtt-base:MqttBase adding null error listener +0ms
  mqttjs:client end :: (test0124) +16s
  mqttjs:client end :: cb? true +0ms
  mqttjs:client _clearReconnect : clearing reconnect timer +1ms
  mqttjs:client end :: (test0124) :: calling finish in 10ms once outgoing is empty +0ms
  mqttjs:client stream: emit close to MqttClient +1ms
  azure-iot-mqtt-base:translateError:Errors translating: TimeoutError: Message not acknowledged to TimeoutError: Message not acknowledged +0ms
  azure-iot-device-mqtt:Mqtt:Errors send error: TimeoutError: Message not acknowledged +0ms
  azure-iot-common:RetryOperation sendEvent:2 Will retry after: 100 milliseconds +35s
  azure-iot-device-mqtt:Mqtt Invoking sendEvent handler in the device client FSM{"data":"{\"deviceId\":\"myFirstDevice\",\"windSpeed\":12.651429463014113,\"temperature\":27.235951562636373,\"humidity\":76.58971969815708}","properties":{"propertyList":[{"key":"temperatureAlert","value":"false"}]},"messageId":"","to":"","lockToken":"","correlationId":"","userId":""} +111ms
  mqttjs:client _checkPing :: checking ping... +2m
  mqttjs:client _checkPing :: ping response received. Clearing flag and sending `pingreq` +1ms
  mqttjs:client _sendPacket :: (test0124) ::  start +0ms
  mqttjs:client sendPacket :: packet: { cmd: 'pingreq' } +1ms
  mqttjs:client sendPacket :: emitting `packetsend` +0ms
  mqttjs:client sendPacket :: writing to stream +1ms
  mqtt-packet:writeToStream generate called +3m
  mqtt-packet:writeToStream generate: packet.cmd: pingreq +1ms
  mqttjs:client sendPacket :: writeToStream result false +2ms
  mqttjs:client sendPacket :: handle events on `drain` once through callback. +1ms
  mqttjs:client _checkPing :: checking ping... +3m
  mqttjs:client _checkPing :: calling _cleanUp with force true +2ms
  mqttjs:client _cleanUp :: forced? true +1ms
  mqttjs:client _cleanUp :: (test0124) :: destroying stream +1ms
  mqttjs:client _cleanUp :: clearing pingTimer +0ms
@riwaida riwaida added the bug label Feb 28, 2022
@github-actions github-actions bot added the IoTSDK tracks all IoT SDK issues across the board label Feb 28, 2022
@anthonyvercolano anthonyvercolano self-assigned this Feb 28, 2022
@r0tc
Copy link

r0tc commented Mar 18, 2022

I observe very similar behavior for Client instance created with the azure-iot-device-mqtt function clientFromConnectionString(). Please verify if the bug doesn't require some kind of high priority since it can generate memory leak as the promises gets never resolved.

@r0tc
Copy link

r0tc commented May 16, 2022

@anthonyvercolano any update if and when it will be investigated?

@riwaida
Copy link
Author

riwaida commented Aug 30, 2022

@vishnureddy17 Do you have any updates on this issue?

@vishnureddy17
Copy link
Member

Hi @riwaida, apologies for the delayed response, and thank you for your patience.

I am still investigating this, but I've been able to reproduce the issue (or at least an issue that looks similar to this). I am actively working on it and should have an answer in the coming week.

@vishnureddy17
Copy link
Member

Just an update, I made a pull request that should fix the issue. I will be out next week, so I'm not able to write the tests and check it in. I've assigned the issue to @anthonyvercolano , he should take it from here.

@anthonyvercolano
Copy link
Contributor

Released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix checked in investigation-required IoTSDK tracks all IoT SDK issues across the board
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants