Fix ci file check error.

This commit is contained in:
xiao-77 2024-11-25 16:45:06 +08:00
parent 5d2bc35569
commit 1451cfb076
3 changed files with 28 additions and 8 deletions

View File

@ -2808,7 +2808,7 @@ int32_t localConfigSerialize(SArray *array, char **serialized) {
}
}
}
cJSON_AddItemToObject(json, "configs", cField);
if (!cJSON_AddItemToObject(json, "configs", cField)) goto _exit;
*serialized = cJSON_Print(json);
_exit:
if (terrno != TSDB_CODE_SUCCESS) {
@ -2890,7 +2890,7 @@ int32_t tSerializeSConfigArray(SEncoder *pEncoder, SArray *array) {
int32_t code = 0;
int32_t lino = 0;
int32_t sz = taosArrayGetSize(array);
tEncodeI32(pEncoder, sz);
TAOS_CHECK_EXIT(tEncodeI32(pEncoder, sz));
for (int i = 0; i < sz; i++) {
SConfigItem *item = (SConfigItem *)taosArrayGet(array, i);
TAOS_CHECK_EXIT(tEncodeCStr(pEncoder, item->name));
@ -2930,7 +2930,7 @@ int32_t tDeserializeSConfigArray(SDecoder *pDecoder, SArray *array) {
int32_t code = 0;
int32_t lino = 0;
int32_t sz = 0;
tDecodeI32(pDecoder, &sz);
TAOS_CHECK_EXIT(tDecodeI32(pDecoder, &sz));
for (int i = 0; i < sz; i++) {
SConfigItem item = {0};
TAOS_CHECK_EXIT(tDecodeCStr(pDecoder, &item.name));
@ -2961,9 +2961,15 @@ int32_t tDeserializeSConfigArray(SDecoder *pDecoder, SArray *array) {
break;
}
}
taosArrayPush(array, &item);
if (taosArrayPush(array, &item) == NULL) {
code = terrno;
goto _exit;
}
}
_exit:
if (code != TSDB_CODE_SUCCESS) {
uError("failed to deserialize SConfigItem at line:%d, since %s", lino, tstrerror(code));
}
return code;
}
@ -3008,7 +3014,10 @@ int32_t compareSConfigItemArrays(SArray *mArray, const SArray *dArray, SArray *d
SConfigItem *dItem = (SConfigItem *)taosArrayGet(dArray, i);
if (!compareSConfigItem(mItem, dItem)) {
code = TSDB_CODE_FAILED;
taosArrayPush(diffArray, mItem);
if (taosArrayPush(diffArray, mItem) == NULL) {
code = terrno;
return code;
}
}
}

View File

@ -330,7 +330,11 @@ static void dmProcessConfigRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
}
}
if (needUpdate) {
setAllConfigs(tsCfg);
code = setAllConfigs(tsCfg);
if (code != TSDB_CODE_SUCCESS) {
dError("failed to set all configs since %s", tstrerror(code));
goto _exit;
}
}
code = taosPersistLocalConfig(pMgmt->path);
if (code != TSDB_CODE_SUCCESS) {

View File

@ -215,7 +215,11 @@ static int32_t mndProcessConfigReq(SRpcMsg *pReq) {
SDnodeObj *pDnode = NULL;
int32_t code = -1;
tDeserializeSConfigReq(pReq->pCont, pReq->contLen, &configReq);
code = tDeserializeSConfigReq(pReq->pCont, pReq->contLen, &configReq);
if (code != 0) {
mError("failed to deserialize config req, since %s", terrstr());
goto _OVER;
}
SArray *diffArray = taosArrayInit(16, sizeof(SConfigItem));
SConfigRsp configRsp = {0};
configRsp.forceReadConfig = configReq.forceReadConfig;
@ -315,7 +319,10 @@ int32_t mndInitReadCfg(SMnode *pMnode) {
mInfo("failed to acquire mnd config:%s, since %s", item->name, terrstr());
continue;
}
cfgUpdateItem(item, newObj);
code = cfgUpdateItem(item, newObj);
if (code != 0) {
mError("failed to update mnd config:%s, since %s", item->name, terrstr());
}
sdbRelease(pMnode->pSdb, newObj);
}
_OVER: