Fix "close timed out" error when performing full deploy or modifying broker node. #3451
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fixes #2934
Types of changes
Proposed changes
Prevent the
close timed out
issue (see references below)node.client.end()
to one location in code base (broker node function.disconnect()
) to reduce code paths and early calls.done
is always called for the "close" event in MQTT In/Out/Broker nodes (node.on('close'
) by removing thedone
callback from thenode.client.end()
signature - since it is (at best) unreliable due to the myriad of combination of user options and order of events (i.e. which nodes close first, flow file ordering, whether node has aclose
packet to sent etc)References...
#2934
martin-doyle/node-red-contrib-aedes#46
martin-doyle/node-red-contrib-aedes#54
https://discourse.nodered.org/t/error-stopping-node-close-timed-out-mqtt-nodes/52830/5
https://discourse.nodered.org/t/mqtt-close-timeout-issue-using-aedes/57583
https://discourse.nodered.org/t/mqtt-in-node-not-working-properly-in-node-red-2-2-1/58428
https://discourse.nodered.org/t/mqtt-connects-then-disconnects/39609/6
Checklist
grunt
to verify the unit tests pass