Skip to content

Commit 16a42a1

Browse files
authored
fix: when server is down, request needs to be handled properly. (#575)
1 parent e6eef58 commit 16a42a1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

polaris-plugins/polaris-plugins-connector/connector-composite/src/main/java/com/tencent/polaris/plugins/connector/composite/CompositeServiceUpdateTask.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,10 @@ public boolean needUpdate() {
106106
@Override
107107
public void execute() {
108108
boolean isServiceUpdateTaskExecuted = false;
109+
int subTaskSize = subServiceUpdateTaskMap.size();
109110
for (Map.Entry<String, ServiceUpdateTask> entry : subServiceUpdateTaskMap.entrySet()) {
110-
if (canExecute(entry.getKey(), entry.getValue())) {
111+
// TODO: check multi connector
112+
if (subTaskSize == 1 || canExecute(entry.getKey(), entry.getValue())) {
111113
isServiceUpdateTaskExecuted = true;
112114
entry.getValue().setStatus(ServiceUpdateTaskConstant.Status.READY, ServiceUpdateTaskConstant.Status.RUNNING);
113115
entry.getValue().execute(this);
@@ -126,6 +128,7 @@ public void execute() {
126128
|| serviceEventKey.getEventType().equals(EventType.BLOCK_ALLOW_RULE)))) {
127129
return;
128130
}
131+
129132
boolean svcDeleted = this.notifyServerEvent(
130133
new ServerEvent(serviceEventKey, DiscoverResponse.newBuilder().build(), null));
131134
if (!svcDeleted) {

0 commit comments

Comments
 (0)