You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ignite.apache.org by GitBox <gi...@apache.org> on 2022/11/02 12:31:30 UTC

[GitHub] [ignite-3] sergeyuttsel commented on a diff in pull request #1282: IGNITE-17899 Properly stopping resources in TableManager.

sergeyuttsel commented on code in PR #1282:
URL: https://github.com/apache/ignite-3/pull/1282#discussion_r1011688009


##########
modules/table/src/main/java/org/apache/ignite/internal/table/distributed/TableManager.java:
##########
@@ -969,18 +971,28 @@ public void stop() {
      */
     private void cleanUpTablesResources(Map<UUID, TableImpl> tables) {
         for (TableImpl table : tables.values()) {
-            try {
-                for (int p = 0; p < table.internalTable().partitions(); p++) {
-                    TablePartitionId replicationGroupId = new TablePartitionId(table.tableId(), p);
+            for (int p = 0; p < table.internalTable().partitions(); p++) {
+                TablePartitionId replicationGroupId = new TablePartitionId(table.tableId(), p);
 
+                try {
                     raftMgr.stopRaftGroup(replicationGroupId);
+                } catch (Exception e) {
+                    LOG.info("Unable to stop the raft group [tableName={}, partition={}]", e, table.name(), p);
+                }
 
+                try {
                     replicaMgr.stopReplica(replicationGroupId);
+                } catch (Exception e) {
+                    LOG.info("Unable to stop the replica [tableName={}, partition={}]", e, table.name(), p);
                 }
+            }
 
-                table.internalTable().storage().stop();
-                table.internalTable().txStateStorage().stop();
-                table.internalTable().close();
+            try {
+                IgniteUtils.closeAll(
+                        Stream.of(table.internalTable().storage(),

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@ignite.apache.org

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