You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2022/03/18 07:53:18 UTC

[GitHub] [shardingsphere] soulasuna opened a new pull request #16185: Reconnect and re-register computing node when session times out

soulasuna opened a new pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185


   ## Reconnect and re-register computing node when Proxy session times out.
   
   Related to #16183.
   
   Changes proposed in this pull request:
   - Add session connection listener
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] menghaoranss merged pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
menghaoranss merged pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#discussion_r829771506



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       Why use `while` here?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] soulasuna commented on a change in pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#discussion_r829810337



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#discussion_r829771506



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       Why use `while` here?

##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       But there is a `return` in the loop.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] TeslaCN commented on a change in pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
TeslaCN commented on a change in pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#discussion_r829793273



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       But there is a `return` in the loop.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] codecov-commenter commented on pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#issuecomment-1072649462


   # [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/16185?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#16185](https://codecov.io/gh/apache/shardingsphere/pull/16185?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (a43ffbf) into [master](https://codecov.io/gh/apache/shardingsphere/commit/45510810a2e655761ffd854441b41afe1db919e5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4551081) will **increase** coverage by `0.09%`.
   > The diff coverage is `17.85%`.
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #16185      +/-   ##
   ============================================
   + Coverage     60.42%   60.52%   +0.09%     
   - Complexity     2052     2064      +12     
   ============================================
     Files          3285     3292       +7     
     Lines         49649    49845     +196     
     Branches       8551     8558       +7     
   ============================================
   + Hits          30001    30167     +166     
   - Misses        17129    17146      +17     
   - Partials       2519     2532      +13     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/shardingsphere/pull/16185?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...shardingsphere/infra/instance/InstanceContext.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtaW5mcmEvc2hhcmRpbmdzcGhlcmUtaW5mcmEtY29tbW9uL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9pbmZyYS9pbnN0YW5jZS9JbnN0YW5jZUNvbnRleHQuamF2YQ==) | `46.15% <ø> (-1.35%)` | :arrow_down: |
   | [...itory/cluster/ClusterPersistRepositoryFactory.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5L3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LWFwaS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvbW9kZS9yZXBvc2l0b3J5L2NsdXN0ZXIvQ2x1c3RlclBlcnNpc3RSZXBvc2l0b3J5RmFjdG9yeS5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [...e/mode/repository/cluster/etcd/EtcdRepository.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5L3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LXByb3ZpZGVyL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LWV0Y2Qvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NoYXJkaW5nc3BoZXJlL21vZGUvcmVwb3NpdG9yeS9jbHVzdGVyL2V0Y2QvRXRjZFJlcG9zaXRvcnkuamF2YQ==) | `74.60% <0.00%> (-1.21%)` | :arrow_down: |
   | [.../cluster/zookeeper/CuratorZookeeperRepository.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5L3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LXByb3ZpZGVyL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LXpvb2tlZXBlci1jdXJhdG9yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL3JlcG9zaXRvcnkvY2x1c3Rlci96b29rZWVwZXIvQ3VyYXRvclpvb2tlZXBlclJlcG9zaXRvcnkuamF2YQ==) | `53.43% <0.00%> (-0.83%)` | :arrow_down: |
   | [.../zookeeper/listener/SessionConnectionListener.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5L3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LXByb3ZpZGVyL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1yZXBvc2l0b3J5LXpvb2tlZXBlci1jdXJhdG9yL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL3JlcG9zaXRvcnkvY2x1c3Rlci96b29rZWVwZXIvbGlzdGVuZXIvU2Vzc2lvbkNvbm5lY3Rpb25MaXN0ZW5lci5qYXZh) | `0.00% <0.00%> (ø)` | |
   | [.../manager/cluster/ClusterContextManagerBuilder.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtbW9kZS9zaGFyZGluZ3NwaGVyZS1tb2RlLXR5cGUvc2hhcmRpbmdzcGhlcmUtY2x1c3Rlci1tb2RlL3NoYXJkaW5nc3BoZXJlLWNsdXN0ZXItbW9kZS1jb3JlL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9zaGFyZGluZ3NwaGVyZS9tb2RlL21hbmFnZXIvY2x1c3Rlci9DbHVzdGVyQ29udGV4dE1hbmFnZXJCdWlsZGVyLmphdmE=) | `59.21% <71.42%> (+0.54%)` | :arrow_up: |
   | [...dbc/transaction/JDBCBackendTransactionManager.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC9jb21tdW5pY2F0aW9uL2pkYmMvdHJhbnNhY3Rpb24vSkRCQ0JhY2tlbmRUcmFuc2FjdGlvbk1hbmFnZXIuamF2YQ==) | `46.96% <0.00%> (-39.04%)` | :arrow_down: |
   | [...nd/text/transaction/TransactionBackendHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L3RyYW5zYWN0aW9uL1RyYW5zYWN0aW9uQmFja2VuZEhhbmRsZXIuamF2YQ==) | `16.39% <0.00%> (-4.02%)` | :arrow_down: |
   | [.../jta/connection/dialect/H2XAConnectionWrapper.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUta2VybmVsL3NoYXJkaW5nc3BoZXJlLXRyYW5zYWN0aW9uL3NoYXJkaW5nc3BoZXJlLXRyYW5zYWN0aW9uLXR5cGUvc2hhcmRpbmdzcGhlcmUtdHJhbnNhY3Rpb24teGEvc2hhcmRpbmdzcGhlcmUtdHJhbnNhY3Rpb24teGEtY29yZS9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvdHJhbnNhY3Rpb24veGEvanRhL2Nvbm5lY3Rpb24vZGlhbGVjdC9IMlhBQ29ubmVjdGlvbldyYXBwZXIuamF2YQ==) | `76.92% <0.00%> (-3.08%)` | :arrow_down: |
   | [...on/queryable/ExportSchemaConfigurationHandler.java](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2hhcmRpbmdzcGhlcmUtcHJveHkvc2hhcmRpbmdzcGhlcmUtcHJveHktYmFja2VuZC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2hhcmRpbmdzcGhlcmUvcHJveHkvYmFja2VuZC90ZXh0L2Rpc3RzcWwvcmFsL2NvbW1vbi9xdWVyeWFibGUvRXhwb3J0U2NoZW1hQ29uZmlndXJhdGlvbkhhbmRsZXIuamF2YQ==) | `65.93% <0.00%> (-3.04%)` | :arrow_down: |
   | ... and [52 more](https://codecov.io/gh/apache/shardingsphere/pull/16185/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/shardingsphere/pull/16185?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/shardingsphere/pull/16185?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [4551081...a43ffbf](https://codecov.io/gh/apache/shardingsphere/pull/16185?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] soulasuna commented on a change in pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#discussion_r829790147



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       Here is an asynchronous process.
   When session time out  will keep trying to connect to the registry will always try to connect to the registry every 5 seconds.
   Return when re-registered. 
   

##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       Fixed




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [shardingsphere] soulasuna commented on a change in pull request #16185: Reconnect and re-register computing node when session times out

Posted by GitBox <gi...@apache.org>.
soulasuna commented on a change in pull request #16185:
URL: https://github.com/apache/shardingsphere/pull/16185#discussion_r829790147



##########
File path: shardingsphere-mode/shardingsphere-mode-type/shardingsphere-cluster-mode/shardingsphere-cluster-mode-repository/shardingsphere-cluster-mode-repository-provider/shardingsphere-cluster-mode-repository-zookeeper-curator/src/main/java/org/apache/shardingsphere/mode/repository/cluster/zookeeper/listener/SessionConnectionListener.java
##########
@@ -0,0 +1,71 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.shardingsphere.mode.repository.cluster.zookeeper.listener;
+
+import lombok.RequiredArgsConstructor;
+import lombok.SneakyThrows;
+import org.apache.curator.framework.CuratorFramework;
+import org.apache.curator.framework.state.ConnectionState;
+import org.apache.curator.framework.state.ConnectionStateListener;
+import org.apache.shardingsphere.infra.instance.definition.InstanceDefinition;
+import org.apache.shardingsphere.mode.metadata.persist.node.ComputeNode;
+import org.apache.shardingsphere.mode.repository.cluster.ClusterPersistRepository;
+import org.apache.shardingsphere.mode.repository.cluster.zookeeper.handler.CuratorZookeeperExceptionHandler;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Session connection state listener.
+ */
+@RequiredArgsConstructor
+public final class SessionConnectionListener implements ConnectionStateListener {
+    
+    private static final int RECONNECT_INTERVAL_SECONDS = 5;
+    
+    private final InstanceDefinition instanceDefinition;
+    
+    private final ClusterPersistRepository repository;
+    
+    @Override
+    public void stateChanged(final CuratorFramework client, final ConnectionState connectionState) {
+        if (ConnectionState.LOST == connectionState) {
+            while (reRegister(client)) {

Review comment:
       Here is an asynchronous process.
   When session time out  will keep trying to connect to the registry will always try to connect to the registry every 5 seconds.
   Return when re-registered. 
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org