sashapolo commented on code in PR #2792:
URL: https://github.com/apache/ignite-3/pull/2792#discussion_r1381745076
##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -989,73 +999,46 @@ public void stop() {
* @param tables Tables to stop.
*/
private void cleanUpTablesResources(Map<Integer, TableImpl> tables) {
- for (TableImpl table : tables.values()) {
- table.beforeClose();
-
- List<Runnable> stopping = new ArrayList<>();
+ var futures = new ArrayList<CompletableFuture<Void>>();
- AtomicReference<Throwable> throwable = new AtomicReference<>();
+ for (TableImpl table : tables.values()) {
+ futures.add(runAsync(() -> {
+ Stream.Builder<ManuallyCloseable> stopping = Stream.builder();
- AtomicBoolean nodeStoppingEx = new AtomicBoolean();
+ stopping.add(table::beforeClose);
- InternalTable internalTable = table.internalTable();
+ InternalTable internalTable = table.internalTable();
- for (int p = 0; p < internalTable.partitions(); p++) {
- int partitionId = p;
+ for (int p = 0; p < internalTable.partitions(); p++) {
+ TablePartitionId replicationGroupId = new
TablePartitionId(table.tableId(), p);
- TablePartitionId replicationGroupId = new
TablePartitionId(table.tableId(), p);
+ stopping.add(() ->
raftMgr.stopRaftNodes(replicationGroupId));
Review Comment:
> The order seems strange to me
Well, this was the original order, I didn't change anything here.
> Basically the order of stopping will should be opposite to the order of
starting, right?
I agree, let's change it
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]