ifesdjeen commented on code in PR #3976:
URL: https://github.com/apache/cassandra/pull/3976#discussion_r1992192813


##########
src/java/org/apache/cassandra/service/accord/AccordConfigurationService.java:
##########
@@ -399,32 +398,30 @@ private void fetchTopologyAsync(long epoch, 
BiConsumer<Object, ? super Throwable
                 return;
             }
 
-            try
+            Set<InetAddressAndPort> peers = new 
HashSet<>(metadata.directory.allJoinedEndpoints());
+            peers.remove(FBUtilities.getBroadcastAddressAndPort());
+            if (peers.isEmpty())
             {
-                Set<InetAddressAndPort> peers = new 
HashSet<>(metadata.directory.allJoinedEndpoints());
-                peers.remove(FBUtilities.getBroadcastAddressAndPort());
-                if (peers.isEmpty())
-                {
-                    onResult.accept(Success, null);
-                    return;
-                }
-
-                // Fetching only one epoch here since later epochs might have 
already been requested concurrently
-                TopologyRange result = 
FetchTopologies.fetch(SharedContext.Global.instance, peers, epoch, epoch).get();
-                result.forEach(this::reportTopology, epoch, 1);
                 onResult.accept(Success, null);
+                return;
             }
-            catch (Throwable e)
-            {
-                if (currentEpoch() >= epoch)
-                {
-                    onResult.accept(Success, null);
-                    return;
-                }
-                if (e instanceof InterruptedException)
-                    Thread.currentThread().interrupt();
-                onResult.accept(null, e);
-            }
+
+            // Fetching only one epoch here since later epochs might have 
already been requested concurrently
+            FetchTopologies.fetch(SharedContext.Global.instance, peers, epoch, 
epoch)

Review Comment:
   This is just making `fetch` asynchronous; I think it should have no positive 
or negative impact on tests, but blocking `get` was unnerving, and we would get 
stuck here often on shutdown.



-- 
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: pr-unsubscr...@cassandra.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to