From 6ad8c3d34d4c7472a283a8bc856896bea15c446c Mon Sep 17 00:00:00 2001 From: shedfreewu Date: Wed, 11 Dec 2024 15:23:21 +0800 Subject: [PATCH] fix: when server is down, request needs to be handled properly. --- .../connector/composite/CompositeServiceUpdateTask.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/polaris-plugins/polaris-plugins-connector/connector-composite/src/main/java/com/tencent/polaris/plugins/connector/composite/CompositeServiceUpdateTask.java b/polaris-plugins/polaris-plugins-connector/connector-composite/src/main/java/com/tencent/polaris/plugins/connector/composite/CompositeServiceUpdateTask.java index c67aed03b..9b723e8ce 100644 --- a/polaris-plugins/polaris-plugins-connector/connector-composite/src/main/java/com/tencent/polaris/plugins/connector/composite/CompositeServiceUpdateTask.java +++ b/polaris-plugins/polaris-plugins-connector/connector-composite/src/main/java/com/tencent/polaris/plugins/connector/composite/CompositeServiceUpdateTask.java @@ -106,8 +106,10 @@ public boolean needUpdate() { @Override public void execute() { boolean isServiceUpdateTaskExecuted = false; + int subTaskSize = subServiceUpdateTaskMap.size(); for (Map.Entry entry : subServiceUpdateTaskMap.entrySet()) { - if (canExecute(entry.getKey(), entry.getValue())) { + // TODO: check multi connector + if (subTaskSize == 1 || canExecute(entry.getKey(), entry.getValue())) { isServiceUpdateTaskExecuted = true; entry.getValue().setStatus(ServiceUpdateTaskConstant.Status.READY, ServiceUpdateTaskConstant.Status.RUNNING); entry.getValue().execute(this); @@ -126,6 +128,7 @@ public void execute() { || serviceEventKey.getEventType().equals(EventType.BLOCK_ALLOW_RULE)))) { return; } + boolean svcDeleted = this.notifyServerEvent( new ServerEvent(serviceEventKey, DiscoverResponse.newBuilder().build(), null)); if (!svcDeleted) {