fix/TD-30989

This commit is contained in:
dmchen 2024-07-23 09:56:13 +00:00
parent 57284ca121
commit 47a16a9456
1 changed files with 18 additions and 20 deletions

View File

@ -15,11 +15,11 @@
#define _DEFAULT_SOURCE
#include "monInt.h"
#include "taos_monitor.h"
#include "taoserror.h"
#include "tglobal.h"
#include "thttp.h"
#include "ttime.h"
#include "taos_monitor.h"
#include "tglobal.h"
SMonitor tsMonitor = {0};
char *tsMonUri = "/report";
@ -54,8 +54,7 @@ int32_t monGetLogs(SMonLogs *logs) {
taosArrayClear(tsMonitor.logs);
taosThreadMutexUnlock(&tsMonitor.lock);
if (logs->logs == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
}
return 0;
}
@ -105,8 +104,7 @@ void monSetBmInfo(SMonBmInfo *pInfo) {
int32_t monInit(const SMonCfg *pCfg) {
tsMonitor.logs = taosArrayInit(16, sizeof(SMonLogItem));
if (tsMonitor.logs == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
return -1;
TAOS_RETURN(TSDB_CODE_OUT_OF_MEMORY);
}
tsMonitor.cfg = *pCfg;
@ -146,6 +144,7 @@ static void monCleanupMonitorInfo(SMonInfo *pMonitor) {
}
static SMonInfo *monCreateMonitorInfo() {
terrno = 0;
SMonInfo *pMonitor = taosMemoryCalloc(1, sizeof(SMonInfo));
if (pMonitor == NULL) {
terrno = TSDB_CODE_OUT_OF_MEMORY;
@ -602,8 +601,7 @@ void monGenAndSendReport() {
monGenLogJson(pMonitor);
monSendReport(pMonitor);
}
else{
} else {
monGenClusterInfoTable(pMonitor);
monGenVgroupInfoTable(pMonitor);
monGenDnodeInfoTable(pMonitor);