Skip to content

Commit

Permalink
fix bug(alibaba#7971) ClusterVersionJudgement ClusterVersionJudge Tas…
Browse files Browse the repository at this point in the history
…k never stop
  • Loading branch information
ye213 committed Mar 22, 2022
1 parent f93813b commit e9cb1bc
Showing 1 changed file with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,18 @@ protected void runVersionListener() {
notifyAllListener();
return;
}
boolean finish = false;
try {
judge();
finish = judge();
} finally {
GlobalExecutor.submitClusterVersionJudge(this::runVersionListener, TimeUnit.SECONDS.toMillis(5));
if(!finish){
GlobalExecutor.submitClusterVersionJudge(this::runVersionListener, TimeUnit.SECONDS.toMillis(5));
}
}
}

protected void judge() {

protected boolean judge() {
boolean finish = false;
Collection<Member> members = memberManager.allMembers();
final String oldVersion = "1.4.0";
boolean allMemberIsNewVersion = true;
Expand All @@ -91,7 +94,9 @@ protected void judge() {
// can only trigger once
if (allMemberIsNewVersion && !this.allMemberIsNewVersion) {
notifyAllListener();
finish = true;
}
return finish;
}

private void notifyAllListener() {
Expand Down

0 comments on commit e9cb1bc

Please sign in to comment.