修复cma上报空报文,cms日志风暴问题
This commit is contained in:
@ -75,6 +75,10 @@ static inline void WakeCmaSendThread()
|
|||||||
|
|
||||||
void PushMsgToCmsSendQue(const char *msgPtr, uint32 msgLen, const char *msgInfo)
|
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};
|
AgentMsgPkg msgPkg = {0};
|
||||||
msgPkg.msgLen = msgLen;
|
msgPkg.msgLen = msgLen;
|
||||||
msgPkg.msgPtr = GetMsgBufAndFillBuf(msgPtr, msgLen);
|
msgPkg.msgPtr = GetMsgBufAndFillBuf(msgPtr, msgLen);
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "cma_connect.h"
|
#include "cma_connect.h"
|
||||||
#include "cma_process_messages_client.h"
|
#include "cma_process_messages_client.h"
|
||||||
#include "cma_instance_management.h"
|
#include "cma_instance_management.h"
|
||||||
|
#include "cma_instance_management_res.h"
|
||||||
#include "cma_instance_check.h"
|
#include "cma_instance_check.h"
|
||||||
#include "cma_mes.h"
|
#include "cma_mes.h"
|
||||||
#include "cma_process_messages.h"
|
#include "cma_process_messages.h"
|
||||||
@ -59,8 +60,10 @@ static void InstancesStatusCheckAndReport(void)
|
|||||||
fenced_UDF_status_check_and_report();
|
fenced_UDF_status_check_and_report();
|
||||||
etcd_status_check_and_report();
|
etcd_status_check_and_report();
|
||||||
kerberos_status_check_and_report();
|
kerberos_status_check_and_report();
|
||||||
SendResStatReportMsg();
|
if (IsCusResExistLocal()) {
|
||||||
SendResIsregReportMsg();
|
SendResStatReportMsg();
|
||||||
|
SendResIsregReportMsg();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AgentSendHeartbeat()
|
static void AgentSendHeartbeat()
|
||||||
|
@ -288,10 +288,6 @@ void *ResourceStatusCheckMain(void *arg)
|
|||||||
|
|
||||||
void SendResStatReportMsg()
|
void SendResStatReportMsg()
|
||||||
{
|
{
|
||||||
if (!IsCusResExistLocal()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ReportResStatus reportMsg = {0};
|
ReportResStatus reportMsg = {0};
|
||||||
reportMsg.msgType = (int)MSG_AGENT_CM_RESOURCE_STATUS;
|
reportMsg.msgType = (int)MSG_AGENT_CM_RESOURCE_STATUS;
|
||||||
|
|
||||||
|
@ -1370,6 +1370,12 @@ void *CM_IOThreadMain(void *argp)
|
|||||||
CloseAllConnections(thrinfo);
|
CloseAllConnections(thrinfo);
|
||||||
|
|
||||||
thrinfo->isBusy = false;
|
thrinfo->isBusy = false;
|
||||||
|
/* wait for events to happen, 5s timeout */
|
||||||
|
if (existSendMsg((PriMsgQues*)thrinfo->sendMsgQue)) {
|
||||||
|
waitTime = 1;
|
||||||
|
} else {
|
||||||
|
waitTime = EPOLL_TIMEOUT;
|
||||||
|
}
|
||||||
uint64 t2 = GetMonotonicTimeMs();
|
uint64 t2 = GetMonotonicTimeMs();
|
||||||
int fds = epoll_pwait(epollHandle, events, MAX_EVENTS, waitTime, &block_sig_set);
|
int fds = epoll_pwait(epollHandle, events, MAX_EVENTS, waitTime, &block_sig_set);
|
||||||
if (fds < 0) {
|
if (fds < 0) {
|
||||||
|
@ -13,11 +13,11 @@
|
|||||||
* See the Mulan PSL v2 for more details.
|
* See the Mulan PSL v2 for more details.
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*
|
*
|
||||||
* cma_instance_management.h
|
* cma_instance_management_res.h
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* include/cm/cm_agent/cma_instance_management.h
|
* include/cm/cm_agent/cma_instance_management_res.h
|
||||||
*
|
*
|
||||||
* -------------------------------------------------------------------------
|
* -------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user