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 2021/10/13 13:36:56 UTC

[GitHub] [ignite-3] AMashenkov commented on a change in pull request #395: IGNITE-15601 Implement stop for calcite module in 3.0

AMashenkov commented on a change in pull request #395:
URL: https://github.com/apache/ignite-3/pull/395#discussion_r728071512



##########
File path: modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/SqlQueryProcessor.java
##########
@@ -96,15 +89,39 @@ public SqlQueryProcessor(
         tableManager.listen(TableEvent.DROP, new TableDroppedListener(schemaHolder));
     }
 
-
     /** {@inheritDoc} */
-    @Override public void stop() throws NodeStoppingException {
-        // TODO: IGNITE-15161 Implement component's stop.
+    @Override public void stop() throws Exception {
+        busyLock.block();
+
+        Exception exOut = null;
+
+        for (AutoCloseable service : new AutoCloseable[] {executionSrvc, msgSrvc, taskExecutor}) {
+            try {
+                service.close();
+            }
+            catch (Exception ex) {
+                if (exOut == null)
+                    exOut = ex;
+                else
+                    exOut.addSuppressed(ex);
+            }
+        }
+
+        if (exOut != null)
+            throw exOut;
     }
 
     /** {@inheritDoc} */
     @Override public List<SqlCursor<List<?>>> query(String schemaName, String qry, Object... params) {
-        return executionSrvc.executeQuery(schemaName, qry, params);
+        if (!busyLock.enterBusy())
+            throw new IgniteException(new NodeStoppingException("Operation has been cancelled (node is stopping)."));

Review comment:
       Maybe this message could be a default one? WDYT?
   I can't imagine a case when NodeStoppingException will be initialized with any other message.




-- 
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