rkondakov commented on a change in pull request #7520: IGNITE-12632: Support of 
cancel command for resource-consuming entities.
URL: https://github.com/apache/ignite/pull/7520#discussion_r393631424
 
 

 ##########
 File path: 
modules/core/src/main/java/org/apache/ignite/internal/visor/service/VisorCancelServiceTask.java
 ##########
 @@ -56,12 +60,30 @@ protected VisorCancelServiceJob(VisorCancelServiceTaskArg 
arg, boolean debug) {
         }
 
         /** {@inheritDoc} */
-        @Override protected Void run(final VisorCancelServiceTaskArg arg) {
+        @Override protected Boolean run(final VisorCancelServiceTaskArg arg) {
             IgniteServices services = ignite.services();
 
-            services.cancel(arg.getName());
+            String svcName = arg.getName();
 
-            return null;
+            Optional<ServiceDescriptor> svc = 
services.serviceDescriptors().stream()
+                .filter(d -> d.name().equalsIgnoreCase(svcName))
+                .findFirst();
+
+            if (!svc.isPresent())
+                return false;
+
+            try {
+                services.cancel(svcName);
+            }
+            catch (IgniteException e) {
+                IgniteLogger log = 
ignite.log().getLogger(VisorCancelServiceTask.class);
+
+                log.warning("Error on service cance.", e);
 
 Review comment:
   Typo

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to