This is an automated email from the ASF dual-hosted git repository.

mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/eventmesh.git


The following commit(s) were added to refs/heads/master by this push:
     new 958b041c7 [ISSUE #4096] InterruptedExceptions should never be ignored 
in the code.[EtcdMetaService]
958b041c7 is described below

commit 958b041c77b1aa074c993c69c34323c515f26712
Author: Harsh Vinod Sawarkar <[email protected]>
AuthorDate: Mon Dec 11 21:37:14 2023 +0530

    [ISSUE #4096] InterruptedExceptions should never be ignored in the 
code.[EtcdMetaService]
---
 .../org/apache/eventmesh/meta/etcd/service/EtcdMetaService.java   | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/eventmesh-meta/eventmesh-meta-etcd/src/main/java/org/apache/eventmesh/meta/etcd/service/EtcdMetaService.java
 
b/eventmesh-meta/eventmesh-meta-etcd/src/main/java/org/apache/eventmesh/meta/etcd/service/EtcdMetaService.java
index 297900cb9..bde4e0870 100644
--- 
a/eventmesh-meta/eventmesh-meta-etcd/src/main/java/org/apache/eventmesh/meta/etcd/service/EtcdMetaService.java
+++ 
b/eventmesh-meta/eventmesh-meta-etcd/src/main/java/org/apache/eventmesh/meta/etcd/service/EtcdMetaService.java
@@ -170,6 +170,9 @@ public class EtcdMetaService implements MetaService {
                     eventMeshDataInfoList.add(eventMeshDataInfo);
                 }
             }
+        } catch (InterruptedException e) {
+            log.error("[EtcdRegistryService][findEventMeshInfoByCluster] 
InterruptedException", e);
+            Thread.currentThread().interrupt();
         } catch (Exception e) {
             log.error("[EtcdRegistryService][findEventMeshInfoByCluster] 
error, clusterName: {}", clusterName, e);
             throw new MetaException(e.getMessage());
@@ -294,7 +297,10 @@ public class EtcdMetaService implements MetaService {
                     List<KeyValue> keyValues = null;
                     try {
                         keyValues = 
etcdClient.getKVClient().get(etcdKey).get().getKvs();
-                    } catch (InterruptedException | ExecutionException e) {
+                    } catch (InterruptedException e) {
+                        log.error("get etcdKey[{}] 
failed[InterruptedException]", etcdKey, e);
+                        Thread.currentThread().interrupt();
+                    } catch (ExecutionException e) {
                         log.error("get etcdKey[{}] failed", etcdKey, e);
                     }
                     if (CollectionUtils.isEmpty(keyValues)) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to