Skip to content

Commit 6d08c98

Browse files
authored
refactor(azure-iot-device): ReconnectStage -> ConnectionStateStage (#1012)
* Renamed ReconnectStage to ConnectionStateStage * Reduced footprint of the connection retry conditional * Updated tests to account for new approach to connection retry conditional * Updated logging
1 parent d2fa4bb commit 6d08c98

6 files changed

Lines changed: 302 additions & 349 deletions

File tree

azure-iot-device/azure/iot/device/common/pipeline/pipeline_stages_base.py

Lines changed: 180 additions & 184 deletions
Large diffs are not rendered by default.

azure-iot-device/azure/iot/device/iothub/pipeline/mqtt_pipeline.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -94,18 +94,14 @@ def __init__(self, pipeline_configuration):
9494
#
9595
.append_stage(pipeline_stages_base.AutoConnectStage())
9696
#
97-
# ReconnectStage needs to be after AutoConnectStage because ReconnectStage sets/clears
98-
# the virtually_connected flag and we want an automatic connection op to set this flag so
99-
# we can reconnect auto-connect operations. This is important, for example, if a
100-
# send_message causes the transport to automatically connect, but that connection fails.
101-
# When that happens, the ReconnectState will hold onto the ConnectOperation until it
102-
# succeeds, and only then will return success to the AutoConnectStage which will
103-
# allow the publish to continue.
97+
# ConnectionStateStage needs to be after AutoConnectStage because the AutoConnectStage
98+
# can create ConnectOperations and we (may) want to queue connection related operations
99+
# in the ConnectionStateStage
104100
#
105-
.append_stage(pipeline_stages_base.ReconnectStage())
101+
.append_stage(pipeline_stages_base.ConnectionStateStage())
106102
#
107-
# ConnectionLockStage needs to be after ReconnectStage because we want any ops that
108-
# ReconnectStage creates to go through the ConnectionLockStage gate
103+
# ConnectionLockStage needs to be after ConnectionStateStage because we want any ops that
104+
# ConnectionStateStage creates to go through the ConnectionLockStage gate
109105
#
110106
.append_stage(pipeline_stages_base.ConnectionLockStage())
111107
#

azure-iot-device/azure/iot/device/provisioning/pipeline/mqtt_pipeline.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ def __init__(self, pipeline_configuration):
8181
#
8282
.append_stage(pipeline_stages_base.AutoConnectStage())
8383
#
84-
# ReconnectStage needs to be after AutoConnectStage because ReconnectStage sets/clears
85-
# the virtually_conencted flag and we want an automatic connection op to set this flag so
86-
# we can reconnect autoconnect operations.
84+
# ConnectionStateStage needs to be after AutoConnectStage because the AutoConnectStage
85+
# can create ConnectOperations and we (may) want to queue connection related operations
86+
# in the ConnectionStateStage
8787
#
88-
.append_stage(pipeline_stages_base.ReconnectStage())
88+
.append_stage(pipeline_stages_base.ConnectionStateStage())
8989
#
90-
# ConnectionLockStage needs to be after ReconnectStage because we want any ops that
91-
# ReconnectStage creates to go through the ConnectionLockStage gate
90+
# ConnectionLockStage needs to be after ConnectionStateStage because we want any ops that
91+
# ConnectionStateStage creates to go through the ConnectionLockStage gate
9292
#
9393
.append_stage(pipeline_stages_base.ConnectionLockStage())
9494
#

0 commit comments

Comments
 (0)