sashapolo commented on code in PR #5179: URL: https://github.com/apache/ignite-3/pull/5179#discussion_r1948596391
########## modules/partition-replicator/src/main/java/org/apache/ignite/internal/partition/replicator/PartitionReplicaLifecycleManager.java: ########## @@ -1295,15 +1330,14 @@ public void loadTableListenerToZoneReplica( Function<RaftCommandRunner, ReplicaListener> tablePartitionReplicaListenerFactory, RaftGroupListener tablePartitionRaftListener ) { - CompletableFuture<Replica> replicaFut = replicaMgr.replica(zonePartitionId); - - assert replicaFut != null && replicaFut.isDone(); - - var zonePartitionReplicaListener = (ZonePartitionReplicaListener) replicaFut.join().listener(); + Listeners listeners = listenersByZonePartitionId.get(zonePartitionId); - zonePartitionReplicaListener.addTableReplicaListener(tablePartitionId, tablePartitionReplicaListenerFactory); + listeners.replicaListenerFuture.thenAccept(zoneReplicaListener -> zoneReplicaListener.addTableReplicaListener( Review Comment: I don't think I fully understand you, there can be no deadlock because we never wait for this future in any thread. I'll add some clarification comments -- 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-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org