Browse Source

#IQRV #comment [Module] 健康实体添加opt=1|2 实体启动失败的告警提示

gifur 4 năm trước cách đây
mục cha
commit
58f7d1850b

+ 21 - 5
Module/mod_healthmanager/HealthManagerFSM.cpp

@@ -251,6 +251,9 @@ unsigned int CHealthManagerFSM::s1_on_event(FSMEvent* pEvt)
 	{
 	case USER_EVT_COREBOOT_FINISHED:
 		pEvt->SetHandled();
+		if (pEvt->param1 == 2) {
+			ShowEntityBootFailedAtFront(m_csErrEntity, Error_InvalidState);
+		}
 		return pEvt->param1;
 		break;
 	case USER_EVT_ENTER_CUSTOMER_MANAGER:
@@ -439,6 +442,7 @@ unsigned int CHealthManagerFSM::s2_on_event(FSMEvent* pEvt)
 				}
 				else if (pEvt->param1 == 2)
 				{
+					ShowEntityBootFailedAtFront(m_csErrEntity, Error_InvalidState);
 					ret = 2;
 				}
 
@@ -617,6 +621,9 @@ unsigned int CHealthManagerFSM::s3_on_event(FSMEvent* pEvt)
 	{
 	case USER_EVT_OPERATING_FINISHED:
 		ret = pEvt->param1;
+        if (ret == 2) {
+            ShowEntityBootFailedAtFront(m_csErrEntity, Error_InvalidState);
+        }
 		pEvt->SetHandled();
 		break;
 	case USER_EVT_ENTER_CUSTOMER_MANAGER:
@@ -635,7 +642,7 @@ void CHealthManagerFSM::s4_on_entry()
 	//oiltmp need to summary info
 	char buf[256];
 	memset(buf,0, sizeof(buf));
-	sprintf(buf, "ver:%s||", m_sysInfo.InstallVersion.ToString().GetData());
+	sprintf(buf, "ver:%s", m_sysInfo.InstallVersion.ToString().GetData());
 	LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_HEALTH_UPLOAD_INFO_ABOUT_TERM, buf);
 	m_accessAuthCheckMD5 = 0;
 	CSmartPointer<IEntityFunction> spEntityFunction = GetEntityBase()->GetFunction();
@@ -1764,6 +1771,10 @@ void CHealthManagerFSM::OnAnswer(CSmartPointer<IAsynWaitSp> pAsynWaitSp)
 	map<CSimpleStringA,EntityLoadInfo>::iterator it;
 	int ret;
 	Dbg("stage %d,%s,result %d",m_eStage,(LPCSTR)new_entry->EntityName,new_entry->ErrorResult);
+	if (entry->op == OP_START_ENTITY && new_entry->ErrorResult != Error_Succeed) {
+		//ShowEntityBootFailedAtFront(new_entry->EntityName, new_entry->ErrorResult, false);
+	}
+
 	switch(m_eStage)
 	{
 	case LOADSTAGE_COREBOOT:
@@ -2180,7 +2191,7 @@ void CHealthManagerFSM::ToLogWarnTermAboutInfo()
 	//LogWarn(Severity_Low, Error_Unexpect, LOG_WARN_HEALTH_UPLOAD_INFO_ABOUT_TERM, strResult.second.c_str());
 }
 
-void CHealthManagerFSM::ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, ErrorCodeEnum bootFailedResult)
+void CHealthManagerFSM::ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, ErrorCodeEnum bootFailedResult, bool isBlock)
 {
 #if defined(RVC_OS_LINUX)
 
@@ -2192,9 +2203,14 @@ void CHealthManagerFSM::ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, Err
 	} else {
 		strErrMsg = CSimpleStringA::Format("%s 模块初始化失败:%s", lpcszEntityName, (LPCTSTR)SpStrError(bootFailedResult));
 	}
-    SP::Module::Comm::LogErrorNotiyStruct notifyItem(bootFailedResult, 0);
-    SP::Module::Comm::LogNotiyMessageStruct notifyMsg(strErrMsg);
-    notifyItem.Notify(notifyMsg);
+
+	if (isBlock) {
+        SP::Module::Comm::LogErrorNotiyStruct notifyItem(bootFailedResult, 0);
+        SP::Module::Comm::LogNotiyMessageStruct notifyMsg(strErrMsg);
+        notifyItem.Notify(notifyMsg);
+	} else {
+		LogError(Severity_High, bootFailedResult, 0, strErrMsg);
+	}
 
 #endif //RVC_OS_LINUX
 }

+ 1 - 1
Module/mod_healthmanager/HealthManagerFSM.h

@@ -280,7 +280,7 @@ private:
 	void ToCheckUPS();
 	void ToLogWarnTermAboutInfo();
 
-	void ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, ErrorCodeEnum bootFailedResult);
+	void ShowEntityBootFailedAtFront(LPCTSTR lpcszEntityName, ErrorCodeEnum bootFailedResult, bool isBlock = true);
 
 private:
 	LoadStage m_eStage;