Skip to content

Add retry delay on topic subscription failures #298

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

Merged
merged 2 commits into from
Jan 19, 2022

Conversation

pennam
Copy link
Collaborator

@pennam pennam commented Jan 13, 2022

Most of the time subscripion failures are caused by wrong device configuration, so retry to subscribe immediately is not solving the problem.

Adding a small delay (1 second )will make the debug error more readable by the user and it will also reduce the amout of subscription requests received by the cloud not slowing down too much the connection process in case of a real connection error.

@github-actions
Copy link

Memory usage change @ eef2605

Board flash % RAM for global variables %
arduino:mbed:envie_m4 🔺 0 - +64 0.0 - +0.01 🔺 +8 - +8 0.0 - 0.0
arduino:mbed:envie_m7 🔺 0 - +64 0.0 - +0.01 🔺 +8 - +8 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 🔺 0 - +8 0.0 - 0.0
arduino:samd:mkr1000 🔺 +48 - +56 +0.02 - +0.02 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrgsm1400 🔺 +48 - +56 +0.02 - +0.02 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrnb1500 🔺 +48 - +48 +0.02 - +0.02 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +48 0.0 - +0.02 🔺 0 - +8 0.0 - +0.02
arduino:samd:nano_33_iot 🔺 0 - +56 0.0 - +0.02 🔺 0 - +8 0.0 - +0.02
esp32:esp32:esp32 🔺 +68 - +72 +0.01 - +0.01 🔺 +8 - +8 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +64 - +80 +0.01 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:mbed:envie_m4 0 0.0 8 0.0 64 0.01 8 0.0 0 0.0 8 0.0 64 0.01 8 0.0
arduino:mbed:envie_m7 64 0.01 8 0.0 64 0.01 8 0.0 0 0.0 8 0.0 64 0.01 8 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 56 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02
arduino:samd:mkrgsm1400 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02 56 0.02 8 0.02
arduino:samd:mkrnb1500 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 48 0.02 8 0.02 48 0.02 8 0.02 40 0.02 8 0.02 48 0.02 8 0.02 0 0.0 0 0.0
arduino:samd:nano_33_iot 48 0.02 8 0.02 48 0.02 8 0.02 40 0.02 8 0.02 56 0.02 8 0.02 0 0.0 0 0.0
esp32:esp32:esp32 68 0.01 8 0.0 72 0.01 8 0.0 72 0.01 8 0.0
esp8266:esp8266:huzzah 80 0.01 0 0.0 80 0.01 0 0.0 64 0.01 0 0.0
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:mbed:envie_m4,0,0.0,8,0.0,64,0.01,8,0.0,0,0.0,8,0.0,64,0.01,8,0.0
arduino:mbed:envie_m7,64,0.01,8,0.0,64,0.01,8,0.0,0,0.0,8,0.0,64,0.01,8,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,56,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,,,,
arduino:samd:mkrgsm1400,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,56,0.02,8,0.02,,,,
arduino:samd:mkrnb1500,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,,,,
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,48,0.02,8,0.02,48,0.02,8,0.02,40,0.02,8,0.02,48,0.02,8,0.02,0,0.0,0,0.0
arduino:samd:nano_33_iot,48,0.02,8,0.02,48,0.02,8,0.02,40,0.02,8,0.02,56,0.02,8,0.02,0,0.0,0,0.0
esp32:esp32:esp32,68,0.01,8,0.0,72,0.01,8,0.0,72,0.01,8,0.0,,,,,,,,
esp8266:esp8266:huzzah,80,0.01,0,0.0,80,0.01,0,0.0,64,0.01,0,0.0,,,,,,,,

@pennam pennam requested review from polldo and aentinger January 13, 2022 10:35
Copy link

@polldo polldo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I left just an advice

@per1234 per1234 added the topic: code Related to content of the project itself label Jan 15, 2022
@codecov-commenter
Copy link

Codecov Report

Merging #298 (696b48e) into master (cb71b92) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #298   +/-   ##
=======================================
  Coverage   95.40%   95.40%           
=======================================
  Files          26       26           
  Lines        1022     1022           
=======================================
  Hits          975      975           
  Misses         47       47           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8e3417a...696b48e. Read the comment docs.

@github-actions
Copy link

Memory usage change @ 696b48e

Board flash % RAM for global variables %
arduino:mbed:envie_m4 🔺 0 - +64 0.0 - +0.01 🔺 +8 - +8 0.0 - 0.0
arduino:mbed:envie_m7 🔺 0 - +64 0.0 - +0.01 🔺 +8 - +8 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 0 - 0 0.0 - 0.0 🔺 0 - +8 0.0 - 0.0
arduino:samd:mkr1000 🔺 +48 - +56 +0.02 - +0.02 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrgsm1400 🔺 +48 - +56 +0.02 - +0.02 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrnb1500 🔺 +48 - +48 +0.02 - +0.02 🔺 +8 - +8 +0.02 - +0.02
arduino:samd:mkrwan1300 0 - 0 0.0 - 0.0 0 - 0 0.0 - 0.0
arduino:samd:mkrwifi1010 🔺 0 - +48 0.0 - +0.02 🔺 0 - +8 0.0 - +0.02
arduino:samd:nano_33_iot 🔺 0 - +56 0.0 - +0.02 🔺 0 - +8 0.0 - +0.02
esp32:esp32:esp32 🔺 +68 - +72 +0.01 - +0.01 🔺 +8 - +8 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +64 - +80 +0.01 - +0.01 0 - 0 0.0 - 0.0
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:mbed:envie_m4 0 0.0 8 0.0 64 0.01 8 0.0 0 0.0 8 0.0 64 0.01 8 0.0
arduino:mbed:envie_m7 64 0.01 8 0.0 64 0.01 8 0.0 0 0.0 8 0.0 64 0.01 8 0.0
arduino:mbed_nano:nanorp2040connect 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 8 0.0 0 0.0 0 0.0
arduino:samd:mkr1000 56 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02
arduino:samd:mkrgsm1400 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02 56 0.02 8 0.02
arduino:samd:mkrnb1500 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02 48 0.02 8 0.02
arduino:samd:mkrwan1300 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0 0 0.0
arduino:samd:mkrwifi1010 48 0.02 8 0.02 48 0.02 8 0.02 40 0.02 8 0.02 48 0.02 8 0.02 0 0.0 0 0.0
arduino:samd:nano_33_iot 48 0.02 8 0.02 48 0.02 8 0.02 40 0.02 8 0.02 56 0.02 8 0.02 0 0.0 0 0.0
esp32:esp32:esp32 68 0.01 8 0.0 72 0.01 8 0.0 72 0.01 8 0.0
esp8266:esp8266:huzzah 80 0.01 0 0.0 80 0.01 0 0.0 64 0.01 0 0.0
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:mbed:envie_m4,0,0.0,8,0.0,64,0.01,8,0.0,0,0.0,8,0.0,64,0.01,8,0.0
arduino:mbed:envie_m7,64,0.01,8,0.0,64,0.01,8,0.0,0,0.0,8,0.0,64,0.01,8,0.0
arduino:mbed_nano:nanorp2040connect,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,8,0.0,0,0.0,0,0.0
arduino:samd:mkr1000,56,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,,,,
arduino:samd:mkrgsm1400,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,56,0.02,8,0.02,,,,
arduino:samd:mkrnb1500,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,48,0.02,8,0.02,,,,
arduino:samd:mkrwan1300,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,0,0.0,,,,,,,,
arduino:samd:mkrwifi1010,48,0.02,8,0.02,48,0.02,8,0.02,40,0.02,8,0.02,48,0.02,8,0.02,0,0.0,0,0.0
arduino:samd:nano_33_iot,48,0.02,8,0.02,48,0.02,8,0.02,40,0.02,8,0.02,56,0.02,8,0.02,0,0.0,0,0.0
esp32:esp32:esp32,68,0.01,8,0.0,72,0.01,8,0.0,72,0.01,8,0.0,,,,,,,,
esp8266:esp8266:huzzah,80,0.01,0,0.0,80,0.01,0,0.0,64,0.01,0,0.0,,,,,,,,

@pennam pennam merged commit bcccca8 into arduino-libraries:master Jan 19, 2022
@pennam pennam deleted the subscribe_retry_delay branch May 17, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants