-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not deadlock when disconnection corner case happens
If a device were to disconnect from the broker before having sent its introspection, the connection lost handler would deadlock trying to acquire the lock on the inflight message queue which is still locked. Fix this by moving the first lock to the connection handler, and check that another lock attempt is performed when connection is lost only if the device is not allowed to reconnect. This still guarantees that the inflight message queue lock is released only when (eventually) the introspection is sent. Signed-off-by: Arnaldo Cesco <arnaldo.cesco@secomind.com>
- Loading branch information
Showing
2 changed files
with
26 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters