Explorar o código

Z991239-5365 #comment 增加启动完成后VtmLoader实体重启的处理;补上实体lost的告警

oilyang hai 1 ano
pai
achega
39709a4965

+ 1 - 0
Module/mod_healthmanager/HealthManagerFSM.h

@@ -52,6 +52,7 @@ enum HealthManger_UserErrorCode {
 	HealthManager_UserErrorCode_SogouInput_UsingSys = 0x50100216,    // 使用普通调用的搜狗输入法
 	HealthManager_UserErrorCode_SogouInput_UsingSDK = 0x50100217    // 使用SDK版本调用的搜狗输入法
 };
+#define HealthManager_UserErrorCode_EntityLost_Start		0x50100300
 
 enum EvtType
 {

+ 3 - 1
Module/mod_healthmanager/mod_healthmanager.cpp

@@ -1775,10 +1775,11 @@ void CHealthManagerEntity::OnEntityStateHook(const char* pszEntityName, const ch
 			else
 				csResultCode = CSimpleStringA::Format("RTA51%c%c", iByteHigh + 0x30, iByteLow - 10 + 0x41);
 			DbgWithLink(LOG_LEVEL_DEBUG, LOG_TYPE_SYSTEM)("resultcode:%s", csResultCode.GetData());
+			LogWarn(Severity_High, Error_Unexpect, HealthManager_UserErrorCode_EntityLost_Start + esi.wEntityDevelopID, tmpWarnMsg.GetData());
 			DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_SYSTEM).setLogCode("QLR0402501Z001").setResultCode(csResultCode.GetData())(tmpWarnMsg.GetData());
 			m_modRunInfo[pszEntityName].lostCount++;
 			//doing nothing before enter main page. HandShake will take it.
-			if (!m_bEnterMainPageEver && m_modRunInfo[pszEntityName].lostCount < m_maxLostTimes)
+			if (m_bEnterMainPageEver && m_modRunInfo[pszEntityName].lostCount < m_maxLostTimes)
 			{
 				EntityLostProcTask* task = new EntityLostProcTask(this, pszEntityName);
 				GetFunction()->PostThreadPoolTask(task);
@@ -1952,6 +1953,7 @@ void CHealthManagerEntity::OnSelfCheckTimeout()
 	{
 		CSimpleStringA pszEntityName(m_activeEntity[i]);
 		//invalid or "HealthManager" itself,no need to check
+		//
 		if (m_activeEntity[i].IsNullOrEmpty() || m_activeEntity[i].Compare(GetEntityName()) == 0)
 			continue;
 		if (tmpTerminalStage.Compare("S") == 0)

+ 14 - 3
Module/mod_vtmloader/VtmLoaderFSM.cpp

@@ -217,9 +217,20 @@ void CVtmLoaderFSM::OnStateTrans(int iSrcState, int iDstState)
 
 void CVtmLoaderFSM::s0_on_entry()
 {
-	LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, "开始网卡、网络连通性检查");
-	NetWorkCheckAndGetSettingTask* task = new NetWorkCheckAndGetSettingTask(this);
-	GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
+	CSimpleStringA csTmpTS("");
+	GetEntityBase()->GetFunction()->GetSysVar("TerminalStage", csTmpTS);
+	if (csTmpTS.Compare("X") != 0)
+	{
+		DbgWithLink(LOG_LEVEL_WARN, LOG_TYPE_USER)("The entity maybe lost, and have beed restart by healthmanager.To do GetConfig only");
+		GetConfig();
+		DbgWithLink(LOG_LEVEL_INFO, LOG_TYPE_USER)("redo GetConfig finished.");
+	}
+	else
+	{
+		LogWarn(Severity_Low, Error_Succeed, VtmLoader_BootInfoPrint, "开始网卡、网络连通性检查");
+		NetWorkCheckAndGetSettingTask* task = new NetWorkCheckAndGetSettingTask(this);
+		GetEntityBase()->GetFunction()->PostThreadPoolTask(task);
+	}
 }
 
 void CVtmLoaderFSM::s0_on_exit()