From 379134fd6c188c0c269b0e5064cc001c0a1b78e4 Mon Sep 17 00:00:00 2001 From: dmchen Date: Tue, 4 Mar 2025 09:41:15 +0800 Subject: [PATCH] ehn:TD-33933-decouple-send-heartbeat-fix-case --- source/util/src/tsched.c | 2 +- source/util/src/ttimer.c | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/source/util/src/tsched.c b/source/util/src/tsched.c index 108168db55..9f0392c418 100644 --- a/source/util/src/tsched.c +++ b/source/util/src/tsched.c @@ -148,7 +148,7 @@ void *taosProcessSchedQueue(void *scheduler) { snprintf(name, tListLen(name), "%s-taskQ", pSched->label); setThreadName(name); int64_t pid = taosGetSelfPthreadId(); - uInfo("scheduler %s is started, thread:%" PRId64, pSched->label, pid); + uInfo("scheduler %s is started, thread:%" PRId64, name, pid); while (1) { if ((ret = tsem_wait(&pSched->fullSem)) != 0) { diff --git a/source/util/src/ttimer.c b/source/util/src/ttimer.c index d6f47fb81b..67f76c6393 100644 --- a/source/util/src/ttimer.c +++ b/source/util/src/ttimer.c @@ -318,17 +318,22 @@ static void addToExpired(tmr_obj_t* head) { schedMsg.msg = NULL; schedMsg.ahandle = head; schedMsg.thandle = NULL; - if (head->priority == 1) { + uint8_t priority = head->priority; + + if (priority == 1) { if (taosScheduleTask(tmrQhandle, &schedMsg) != 0) { tmrError("%s failed to add expired timer[id=%" PRIuPTR "] to queue.", head->ctrl->label, id); } - } else if (head->priority == 2) { + } else if (priority == 2) { if (taosScheduleTask(tmrQhandleHigh, &schedMsg) != 0) { tmrError("%s failed to add expired timer[id=%" PRIuPTR "] to high level queue.", head->ctrl->label, id); } } + else{ + tmrError("%s invalid priority level %d for timer[id=%" PRIuPTR "].", head->ctrl->label, priority, id); + } - tmrDebug("timer[id=%" PRIuPTR "] has been added to queue priority:%d.", id, head->priority); + tmrDebug("timer[id=%" PRIuPTR "] has been added to queue priority:%d.", id, priority); head = next; } }