Skip to content

Commit b2370a0

Browse files
committed
RDKEMW-15927 ,RDKEMW-15007 : [APACA/Xione DE] rbus self-deadlock in XConf privacy mode fetch causing ~188s T2 init delay
Reason for change: When UserSettings sets privacy mode to DO_NOT_SHARE during boot, the rbus SET handler (t2PropertyDataSetHandler) runs synchronously on the single rbus callback thread — executing deleteAllProfiles() with pthread_join, disk I/O, and XConf client restart. The restarted XConf thread calls appendRequestParams() which uses getParameterValue(PRIVACYMODES_RFC) to fetch privacy mode. This issues rbus_get() on T2's own bus handle, requiring the same rbus callback thread that is already blocked processing the SET handler. This creates a self-deadlock with a 15s rbus timeout per attempt, compounded by XCONF_RETRY_TIMEOUT (180s), stalling T2 initialization. Cascading effect: While T2 is stalled, external callers (e.g. WPEFramework SystemServices plugin) invoking t2_event_s() block 15s each on rbus_getUint(Telemetry.OperationalStatus), delaying the dispatch thread by ~188s and blocking sendNotify() for EVT_ONSYSTEMPOWERSTATECHANGED. Fix: - xconfclient.c: Replace getParameterValue(PRIVACYMODES_RFC) with direct getPrivacyMode() call from privacycontrol library. The platform implementation (provided via meta layer bbappend) reads from a local in-memory cache (PRIVACY_STATE), with fallback to Thunder JSON-RPC (local HTTP) and persistent storage — none of which use rbus, eliminating the self-deadlock. ` - xconf-client/Makefile.am: Add privacycontrol include path and build dependency when IS_PRIVACYCONTROL_ENABLED is set. - telemetry_busmessage_sender.c: Add fast-fail file marker check (T2_COMPONENT_READY) before rbus_getUint() in isCachingRequired() to avoid 15s blocking timeout when T2 is not yet ready. Test Procedure: please refer the ticket comments Risks: Medium Signed-off-by: Thamim Razith <ThamimRazith_AbbasAli@comcast.com>
1 parent 31778cc commit b2370a0

3 files changed

Lines changed: 23 additions & 16 deletions

File tree

source/commonlib/telemetry_busmessage_sender.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,13 @@ static bool isCachingRequired( )
663663
return false ;
664664
}
665665

666+
// Fast-fail: check file marker before making rbus call to avoid blocking on timeout
667+
if (access(T2_COMPONENT_READY, F_OK) != 0)
668+
{
669+
EVENT_DEBUG("T2 component not ready (marker file absent), caching event\n");
670+
return true;
671+
}
672+
666673
// Always check for t2 is ready to accept events. Shutdown target can bring down t2 process at runtime
667674
uint32_t t2ReadyStatus;
668675
rbusError_t retVal = RBUS_ERROR_SUCCESS;

source/xconf-client/Makefile.am

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,9 @@ libxconfclient_la_CPPFLAGS = -fPIC -I${PKG_CONFIG_SYSROOT_DIR}$(includedir)/dbus
4141
-I${top_srcdir}/source/protocol/http
4242

4343
libxconfclient_la_DEPENDENCIES = ${top_builddir}/source/ccspinterface/libccspinterface.la ${top_builddir}/source/t2parser/libt2parser.la
44+
45+
if IS_PRIVACYCONTROL_ENABLED
46+
libxconfclient_la_CFLAGS += $(PRIVACYCONTROL_FLAG)
47+
libxconfclient_la_CPPFLAGS += -I${top_srcdir}/source/privacycontrol
48+
libxconfclient_la_DEPENDENCIES += ${top_builddir}/source/privacycontrol/libt2thunder_privacycontrol.la
49+
endif

source/xconf-client/xconfclient.c

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
#include "persistence.h"
4343
#include "telemetry2_0.h"
4444
#include "busInterface.h"
45+
#if defined(PRIVACYMODES_CONTROL)
46+
#include "rdkservices_privacyutils.h"
47+
#endif
4548
#ifdef GTEST_ENABLE
4649
#define curl_easy_setopt curl_easy_setopt_mock
4750
#define curl_easy_getinfo curl_easy_getinfo_mock
@@ -503,22 +506,13 @@ T2ERROR appendRequestParams(CURLU *uri)
503506
rc = curl_url_set(uri, CURLUPART_QUERY, "version=2", CURLU_APPENDQUERY);
504507
T2_CURL_APPENDREQUEST_ERROR(rc);
505508
#if defined(PRIVACYMODES_CONTROL)
506-
if(T2ERROR_SUCCESS == getParameterValue(PRIVACYMODES_RFC, &paramVal))
507-
{
508-
memset(tempBuf, 0, MAX_URL_ARG_LEN);
509-
snprintf(tempBuf, MAX_URL_ARG_LEN, "privacyModes=%s", paramVal);
510-
rc = curl_url_set(uri, CURLUPART_QUERY, tempBuf, CURLU_URLENCODE | CURLU_APPENDQUERY);
511-
T2_CURL_APPENDREQUEST_ERROR(rc);
512-
free(paramVal);
513-
paramVal = NULL;
514-
}
515-
else
516-
{
517-
T2Error("Failed to get Value for %s\n", PRIVACYMODES_RFC);
518-
ret = T2ERROR_FAILURE;
519-
goto error;
520-
}
521-
509+
getPrivacyMode(&paramVal);
510+
memset(tempBuf, 0, MAX_URL_ARG_LEN);
511+
snprintf(tempBuf, MAX_URL_ARG_LEN, "privacyModes=%s", paramVal);
512+
rc = curl_url_set(uri, CURLUPART_QUERY, tempBuf, CURLU_URLENCODE | CURLU_APPENDQUERY);
513+
T2_CURL_APPENDREQUEST_ERROR(rc);
514+
free(paramVal);
515+
paramVal = NULL;
522516
#endif
523517
error:
524518
if (NULL != tempBuf)

0 commit comments

Comments
 (0)