!91 修复cma上报空报文,导致cms日志风暴问题

Merge pull request !91 from yewk/master_01
This commit is contained in:
opengauss-bot 2023-01-09 07:44:40 +00:00 committed by Gitee
commit a0e28fa30c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 17 additions and 8 deletions

View File

@ -75,6 +75,10 @@ static inline void WakeCmaSendThread()
void PushMsgToCmsSendQue(const char *msgPtr, uint32 msgLen, const char *msgInfo)
{
if (msgPtr != NULL && msgLen >= sizeof(int32) && *(int32*)msgPtr == 0) {
write_runlog(LOG, "%s msgPtr is 0. it may be error.\n", msgInfo);
}
AgentMsgPkg msgPkg = {0};
msgPkg.msgLen = msgLen;
msgPkg.msgPtr = GetMsgBufAndFillBuf(msgPtr, msgLen);

View File

@ -31,6 +31,7 @@
#include "cma_connect.h"
#include "cma_process_messages_client.h"
#include "cma_instance_management.h"
#include "cma_instance_management_res.h"
#include "cma_instance_check.h"
#include "cma_mes.h"
#include "cma_process_messages.h"
@ -59,8 +60,10 @@ static void InstancesStatusCheckAndReport(void)
fenced_UDF_status_check_and_report();
etcd_status_check_and_report();
kerberos_status_check_and_report();
SendResStatReportMsg();
SendResIsregReportMsg();
if (IsCusResExistLocal()) {
SendResStatReportMsg();
SendResIsregReportMsg();
}
}
static void AgentSendHeartbeat()

View File

@ -288,10 +288,6 @@ void *ResourceStatusCheckMain(void *arg)
void SendResStatReportMsg()
{
if (!IsCusResExistLocal()) {
return;
}
ReportResStatus reportMsg = {0};
reportMsg.msgType = (int)MSG_AGENT_CM_RESOURCE_STATUS;

View File

@ -1370,6 +1370,12 @@ void *CM_IOThreadMain(void *argp)
CloseAllConnections(thrinfo);
thrinfo->isBusy = false;
/* wait for events to happen, 5s timeout */
if (existSendMsg((PriMsgQues*)thrinfo->sendMsgQue)) {
waitTime = 1;
} else {
waitTime = EPOLL_TIMEOUT;
}
uint64 t2 = GetMonotonicTimeMs();
int fds = epoll_pwait(epollHandle, events, MAX_EVENTS, waitTime, &block_sig_set);
if (fds < 0) {

View File

@ -13,11 +13,11 @@
* See the Mulan PSL v2 for more details.
* -------------------------------------------------------------------------
*
* cma_instance_management.h
* cma_instance_management_res.h
*
*
* IDENTIFICATION
* include/cm/cm_agent/cma_instance_management.h
* include/cm/cm_agent/cma_instance_management_res.h
*
* -------------------------------------------------------------------------
*/