From cf7bae13edcf67ca92342db43e1c829222ba11b1 Mon Sep 17 00:00:00 2001 From: apatel859 Date: Fri, 7 Jun 2024 08:51:17 -0400 Subject: [PATCH 1/3] RDKTV-30790 added retry logic for IARM connect failure Signed-off-by: apatel859 --- helpers/UtilsIarm.h | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/helpers/UtilsIarm.h b/helpers/UtilsIarm.h index 1d50acafe0..213d6fb8bd 100644 --- a/helpers/UtilsIarm.h +++ b/helpers/UtilsIarm.h @@ -3,6 +3,7 @@ #include "UtilsLogging.h" #include "libIBus.h" +#include #define IARM_CHECK(FUNC) { \ if ((res = FUNC) != IARM_RESULT_SUCCESS) { \ @@ -29,19 +30,27 @@ struct IARM { LOGINFO("IARM already connected"); result = true; } else { - res = IARM_Bus_Init(NAME); - LOGINFO("IARM_Bus_Init: %d", res); - if (res == IARM_RESULT_SUCCESS || res == IARM_RESULT_INVALID_STATE /* already inited or connected */) { - res = IARM_Bus_Connect(); - LOGINFO("IARM_Bus_Connect: %d", res); - if (res == IARM_RESULT_SUCCESS || res == IARM_RESULT_INVALID_STATE /* already connected or not inited */) { - result = isConnected(); + unsigned int retryCount = 0; + do + { + res = IARM_Bus_Init(NAME); + LOGINFO("IARM_Bus_Init: %d", res); + if (res == IARM_RESULT_SUCCESS || res == IARM_RESULT_INVALID_STATE /* already inited or connected */) { + res = IARM_Bus_Connect(); + LOGINFO("IARM_Bus_Connect: %d", res); + if (res == IARM_RESULT_SUCCESS || res == IARM_RESULT_INVALID_STATE /* already connected or not inited */) { + result = isConnected(); + LOGERR("ARM_Bus_Connect result: %d res: %d retryCount :%d ",result, res, retryCount); + } else { + LOGERR("IARM_Bus_Connect failure:result :%d res: %d retryCount :%d ",result, res, retryCount); + } } else { - LOGERR("IARM_Bus_Connect failure: %d", res); + LOGERR("IARM_Bus_Init failure: result :%d res: %d retryCount :%d",result, res,retryCount); } - } else { - LOGERR("IARM_Bus_Init failure: %d", res); - } + + if(result == false) usleep(100000); + + }while((result == false) && (retryCount++ < 20)); } return result; @@ -52,7 +61,7 @@ struct IARM { IARM_Result_t res; int isRegistered = 0; res = IARM_Bus_IsConnected(NAME, &isRegistered); - LOGINFO("IARM_Bus_IsConnected: %d (%d)", res, isRegistered); + LOGINFO("IARM_Bus_IsConnected: res:%d isRegistered (%d)", res, isRegistered); return (isRegistered == 1); } From daffd0cf7aa0b2f9eb3dd6ac0859490d5b436d25 Mon Sep 17 00:00:00 2001 From: yuvaramachandran_gurusamy Date: Tue, 25 Jun 2024 12:04:01 +0000 Subject: [PATCH 2/3] Updated the CHANGELOG.md Signed-off-by: yuvaramachandran_gurusamy --- helpers/CHANGELOG.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 helpers/CHANGELOG.md diff --git a/helpers/CHANGELOG.md b/helpers/CHANGELOG.md new file mode 100644 index 0000000000..9ff956143a --- /dev/null +++ b/helpers/CHANGELOG.md @@ -0,0 +1,17 @@ +All notable changes to this RDK Service will be documented in this file. + + Each RDK Service has a CHANGELOG file that contains all changes done so far. When version is updated, add a entry in the CHANGELOG.md at the top with user friendly information on what was changed with the new version. Please don't mention JIRA tickets in CHANGELOG. + + Please Add entry in the CHANGELOG for each version change and indicate the type of change with these labels: + Added for new features. + Changed for changes in existing functionality. + Deprecated for soon-to-be removed features. + Removed for now removed features. + Fixed for any bug fixes. + Security in case of vulnerabilities. + + Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. + + For more details, refer to versioning section under Main README. +## Added - 2024-06-25 +- Added retry logic for IARM connect failure From 417e8cd327a6a04319b4e57dc061974e53a8281b Mon Sep 17 00:00:00 2001 From: apatel859 <48992974+apatel859@users.noreply.github.com> Date: Tue, 25 Jun 2024 08:24:33 -0400 Subject: [PATCH 3/3] Update CHANGELOG.md --- helpers/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers/CHANGELOG.md b/helpers/CHANGELOG.md index 9ff956143a..6fe8066658 100644 --- a/helpers/CHANGELOG.md +++ b/helpers/CHANGELOG.md @@ -13,5 +13,6 @@ All notable changes to this RDK Service will be documented in this file. Changes in CHANGELOG should be updated when commits are added to the main or release branches. There should be one CHANGELOG entry per JIRA Ticket. This is not enforced on sprint branches since there could be multiple changes for the same JIRA ticket during development. For more details, refer to versioning section under Main README. -## Added - 2024-06-25 +## [1.0.1] - 2024-06-25 +### Fixed - Added retry logic for IARM connect failure