You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
IoT - Exponential backoff algorithm wait time calculation error #2242
Exponential backoff in above mentioned file doesn't follow algorithm described in link.
Variable minimum_backoff_time is referenced as global in all functions: listen_for_messages, send_data_from_bound_device and mqtt_device_demo.
But it does not get updated outside, which produces wait(delay) 1 to 2 seconds, not 1, 2, 4, 8 and 32 seconds.
Device client_id is 'projects/example_project_id/locations/europe-west1/registries/example_registry/devices/test_device'
Creating JWT using ES256 from private key file /home/dinko/keys/ec_private.pem
Subscribing to /devices/test_device/commands/#
Publishing message 1/100: 'example_registry/test_device-payload-1'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.173 before reconnecting.
Minimum_backoff_time: 2
Publishing message 2/100: 'example_registry/test_device-payload-2'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.09 before reconnecting.
Minimum_backoff_time: 2
Publishing message 3/100: 'example_registry/test_device-payload-3'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.2 before reconnecting.
Minimum_backoff_time: 2
Publishing message 4/100: 'example_registry/test_device-payload-4'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.6680000000000001 before reconnecting.
Minimum_backoff_time: 2
Publishing message 5/100: 'example_registry/test_device-payload-5'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.7269999999999999 before reconnecting.
Minimum_backoff_time: 2
Publishing message 6/100: 'example_registry/test_device-payload-6'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.289 before reconnecting.
Minimum_backoff_time: 2
Publishing message 7/100: 'example_registry/test_device-payload-7'
on_connect Connection Refused: not authorised.
on_disconnect 5: The connection was refused.
Waiting for 1.194 before reconnecting.
Minimum_backoff_time: 2
Creating JWT using RS256 from private key file resources\\rsa_private.pem
Subscribing to /devices/test/commands/#
Publishing message 1/100: 'test/test-payload-1'
on_disconnect 1: Out of memory.
Waiting for 1.397 before reconnecting.
Publishing message 2/100: 'test/test-payload-2'
on_disconnect 1: Out of memory.
Waiting for 2.097 before reconnecting.
Publishing message 3/100: 'test/test-payload-3'
on_disconnect 1: Out of memory.
Waiting for 4.247 before reconnecting.
Publishing message 4/100: 'test/test-payload-4'
on_disconnect 1: Out of memory.
Waiting for 8.457 before reconnecting.
Publishing message 5/100: 'test/test-payload-5'
on_disconnect 1: Out of memory.
Waiting for 16.81 before reconnecting.
Publishing message 6/100: 'test/test-payload-6'
on_disconnect 1: Out of memory.
Waiting for 32.581 before reconnecting.
I'm using Python 3.7.4, if you have an example for how the device is failing to connect (e.g. expired credentials) and the issue still reproduces, feel free to reopen and I will be able to reproduce this and figure out where the backoff is not working.
Activity
gguuss commentedon Jul 25, 2019
Acknowledged, self assigning.
gguuss commentedon Aug 7, 2019
I'm not seeing this reproduce on my machine:
I'm using Python 3.7.4, if you have an example for how the device is failing to connect (e.g. expired credentials) and the issue still reproduces, feel free to reopen and I will be able to reproduce this and figure out where the backoff is not working.