Skip to content

Commit 740ff93

Browse files
committed
Merge branch 'release/1.9.0'
2 parents 5e5821d + c3239a5 commit 740ff93

21 files changed

Lines changed: 574 additions & 124 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ m4/
2929
.deps/
3030
.libs/
3131

32+
# Libtool wrapper scripts
33+
source/telemetry2_0
34+
source/commonlib/telemetry2_0_client
35+
3236
# Source subdirectory build files
3337
source/**/Makefile
3438
source/**/Makefile.in

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [1.9.0](https://github.com/rdkcentral/telemetry/compare/1.8.8...1.9.0)
8+
9+
- RDK-60291: RDK Coverity Defect Resolution [`#319`](https://github.com/rdkcentral/telemetry/pull/319)
10+
711
#### [1.8.8](https://github.com/rdkcentral/telemetry/compare/1.8.7...1.8.8)
812

913
> 7 April 2026
1014
1115
- DELIA-70280 : [Xione DE] rbus self-deadlock in XConf privacy mode fetch causing ~188s T2 init delay [`#303`](https://github.com/rdkcentral/telemetry/pull/303)
16+
- Changelog updates for release 1.8.8 [`6e32097`](https://github.com/rdkcentral/telemetry/commit/6e32097d4d38675b49b7a400de3e65dc42c12334)
1217

1318
#### [1.8.7](https://github.com/rdkcentral/telemetry/compare/1.8.6...1.8.7)
1419

source/bulkdata/datamodel.c

Lines changed: 68 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,28 @@ static void *process_rp_thread(void *data)
5050
{
5151
(void) data;//To fix compiler warning
5252
cJSON *reportProfiles = NULL;
53+
bool shouldContinue = true;
5354

5455
T2Debug("%s ++in\n", __FUNCTION__);
5556

56-
while(!stopProcessing)
57+
while(shouldContinue)
5758
{
5859
pthread_mutex_lock(&rpMutex);
60+
shouldContinue = !stopProcessing;
61+
if(!shouldContinue)
62+
{
63+
pthread_mutex_unlock(&rpMutex);
64+
break;
65+
}
5966
T2Info("%s: Waiting for event from tr-181 \n", __FUNCTION__);
60-
pthread_cond_wait(&rpCond, &rpMutex);
67+
while(t2_queue_count(rpQueue) == 0 && shouldContinue)
68+
{
69+
pthread_cond_wait(&rpCond, &rpMutex);
70+
shouldContinue = !stopProcessing;
71+
}
6172

6273
T2Debug("%s: Received wake up signal \n", __FUNCTION__);
63-
if(t2_queue_count(rpQueue) > 0)
74+
if(t2_queue_count(rpQueue) > 0 && shouldContinue)
6475
{
6576
reportProfiles = (cJSON *)t2_queue_pop(rpQueue);
6677
if (reportProfiles)
@@ -80,17 +91,32 @@ static void *process_tmprp_thread(void *data)
8091
{
8192
(void) data;//To fix compiler warning
8293
cJSON *tmpReportProfiles = NULL;
94+
bool shouldContinue = true;
8395

8496
T2Debug("%s ++in\n", __FUNCTION__);
8597

86-
while(!stopProcessing)
98+
while(shouldContinue)
8799
{
88100
pthread_mutex_lock(&tmpRpMutex);
101+
pthread_mutex_lock(&rpMutex);
102+
shouldContinue = !stopProcessing;
103+
pthread_mutex_unlock(&rpMutex);
104+
if(!shouldContinue)
105+
{
106+
pthread_mutex_unlock(&tmpRpMutex);
107+
break;
108+
}
89109
T2Info("%s: Waiting for event from tr-181 \n", __FUNCTION__);
90-
pthread_cond_wait(&tmpRpCond, &tmpRpMutex);
110+
while(t2_queue_count(tmpRpQueue) == 0 && shouldContinue)
111+
{
112+
pthread_cond_wait(&tmpRpCond, &tmpRpMutex);
113+
pthread_mutex_lock(&rpMutex);
114+
shouldContinue = !stopProcessing;
115+
pthread_mutex_unlock(&rpMutex);
116+
}
91117

92118
T2Debug("%s: Received wake up signal \n", __FUNCTION__);
93-
if(t2_queue_count(tmpRpQueue) > 0)
119+
if(t2_queue_count(tmpRpQueue) > 0 && shouldContinue)
94120
{
95121
tmpReportProfiles = (cJSON *)t2_queue_pop(tmpRpQueue);
96122
if (tmpReportProfiles)
@@ -110,11 +136,31 @@ static void *process_msg_thread(void *data)
110136
{
111137
(void) data;//To fix compiler warning
112138
struct __msgpack__ *msgpack;
113-
while(!stopProcessing)
139+
bool shouldContinue = true;
140+
141+
while(shouldContinue)
114142
{
143+
// Check stopProcessing first without holding rpMsgMutex to avoid
144+
// nested mutex acquisition which could lead to deadlock if another
145+
// thread acquires these mutexes in opposite order (e.g., rpMutex then rpMsgMutex)
146+
pthread_mutex_lock(&rpMutex);
147+
shouldContinue = !stopProcessing;
148+
pthread_mutex_unlock(&rpMutex);
149+
150+
if(!shouldContinue)
151+
{
152+
break;
153+
}
154+
115155
pthread_mutex_lock(&rpMsgMutex);
116-
pthread_cond_wait(&msg_Cond, &rpMsgMutex);
117-
if(t2_queue_count(rpMsgPkgQueue) > 0)
156+
while(t2_queue_count(rpMsgPkgQueue) == 0 && shouldContinue)
157+
{
158+
pthread_cond_wait(&msg_Cond, &rpMsgMutex);
159+
pthread_mutex_lock(&rpMutex);
160+
shouldContinue = !stopProcessing;
161+
pthread_mutex_unlock(&rpMutex);
162+
}
163+
if(t2_queue_count(rpMsgPkgQueue) > 0 && shouldContinue)
118164
{
119165
msgpack = (struct __msgpack__ *)t2_queue_pop(rpMsgPkgQueue);
120166
if (msgpack)
@@ -274,18 +320,24 @@ T2ERROR datamodel_MsgpackProcessProfile(char *str, int strSize)
274320

275321
msgpack->msgpack_blob = str;
276322
msgpack->msgpack_blob_size = strSize;
277-
pthread_mutex_lock(&rpMsgMutex);
278-
if (!stopProcessing)
279-
{
280-
t2_queue_push(rpMsgPkgQueue, (void *)msgpack);
281-
pthread_cond_signal(&msg_Cond);
282-
}
283-
else
323+
324+
// Check stopProcessing without holding rpMsgMutex to avoid nested mutex
325+
// acquisition which could lead to deadlock
326+
pthread_mutex_lock(&rpMutex);
327+
bool isProcessing = !stopProcessing;
328+
pthread_mutex_unlock(&rpMutex);
329+
330+
if (!isProcessing)
284331
{
285332
free(msgpack->msgpack_blob);
286333
free(msgpack);
287334
T2Error("Datamodel not initialized, dropping request \n");
335+
return T2ERROR_SUCCESS;
288336
}
337+
338+
pthread_mutex_lock(&rpMsgMutex);
339+
t2_queue_push(rpMsgPkgQueue, (void *)msgpack);
340+
pthread_cond_signal(&msg_Cond);
289341
pthread_mutex_unlock(&rpMsgMutex);
290342
return T2ERROR_SUCCESS;
291343
}

0 commit comments

Comments
 (0)