mirror of
https://gitee.com/BTAJL/repchain.git
synced 2024-11-30 02:38:24 +08:00
fix: 节点重启策略中的bug(检查status是否为UP部分的代码)
修改cluster建立时机到init函数。 引用clusterOfInner变量。
This commit is contained in:
parent
fcc13802d8
commit
60208825b1
@ -139,6 +139,7 @@ object RepChainMgr {
|
||||
breakable {
|
||||
//持续6min,检查自己是否UP,每次检查的超时时间为120s,检查3次
|
||||
for(i <-1 to 3){
|
||||
Thread.sleep(10000)
|
||||
if(isUpOfClusterForChecked(cluster)){
|
||||
r = true
|
||||
break
|
||||
@ -153,7 +154,7 @@ object RepChainMgr {
|
||||
var r = false
|
||||
try{
|
||||
System.err.println(s"shutdown start time=${System.currentTimeMillis()}")
|
||||
var r = shutdown(systemName)
|
||||
shutdown(systemName)
|
||||
System.err.println(s"shutdown end time=${System.currentTimeMillis()}")
|
||||
Thread.sleep(5000)
|
||||
System.err.println(s"terminateOfSystem finished,systemName=${systemName}")
|
||||
|
@ -209,7 +209,9 @@ class ClusterSystem(sysTag: String, initType: Int, sysStart: Boolean) {
|
||||
initConsensusNodeOfConfig
|
||||
if (sysStart) {
|
||||
sysActor = ActorSystem(SystemConf.SYSTEM_NAME, sysConf)
|
||||
clusterAddr = Cluster(sysActor).selfAddress
|
||||
clusterOfInner = Cluster(sysActor)
|
||||
clusterAddr = clusterOfInner.selfAddress
|
||||
//clusterAddr = Cluster(sysActor).selfAddress
|
||||
}
|
||||
|
||||
RepLogger.trace(RepLogger.System_Logger, sysTag + "~" + "System" + " ~ " + s"System(${sysTag}) init successfully" + " ~ ")
|
||||
@ -246,7 +248,8 @@ class ClusterSystem(sysTag: String, initType: Int, sysStart: Boolean) {
|
||||
}
|
||||
|
||||
def shutdown = {
|
||||
Cluster(sysActor).down(clusterAddr)
|
||||
//Cluster(sysActor).down(clusterAddr)
|
||||
this.clusterOfInner.down(clusterAddr)
|
||||
System.err.println(s"shutdown ~~ address=${clusterAddr.toString},systemname=${this.sysTag}")
|
||||
}
|
||||
|
||||
@ -286,7 +289,8 @@ class ClusterSystem(sysTag: String, initType: Int, sysStart: Boolean) {
|
||||
|
||||
if (!hasDiskSpace) {
|
||||
RepLogger.sendAlertToDB(new AlertInfo("STORAGE",1,s"Node Name=${this.sysTag},Insufficient disk space."))
|
||||
Cluster(sysActor).down(clusterAddr)
|
||||
//Cluster(sysActor).down(clusterAddr)
|
||||
this.clusterOfInner.down(clusterAddr)
|
||||
throw new Exception("not enough disk space")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user