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 2020/11/06 13:47:13 UTC

[GitHub] [ignite] alex-plekhanov opened a new pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

alex-plekhanov opened a new pull request #8431:
URL: https://github.com/apache/ignite/pull/8431


   …ployed via DeploymentSPI service
   
   Thank you for submitting the pull request to the Apache Ignite.
   
   In order to streamline the review of the contribution 
   we ask you to ensure the following steps have been taken:
   
   ### The Contribution Checklist
   - [ ] There is a single JIRA ticket related to the pull request. 
   - [ ] The web-link to the pull request is attached to the JIRA ticket.
   - [ ] The JIRA ticket has the _Patch Available_ state.
   - [ ] The pull request body describes changes that have been made. 
   The description explains _WHAT_ and _WHY_ was made instead of _HOW_.
   - [ ] The pull request title is treated as the final commit message. 
   The following pattern must be used: `IGNITE-XXXX Change summary` where `XXXX` - number of JIRA issue.
   - [ ] A reviewer has been mentioned through the JIRA comments 
   (see [the Maintainers list](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute#HowtoContribute-ReviewProcessandMaintainers)) 
   - [ ] The pull request has been checked by the Teamcity Bot and 
   the `green visa` attached to the JIRA ticket (see [TC.Bot: Check PR](https://mtcga.gridgain.com/prs.html))
   
   ### Notes
   - [How to Contribute](https://cwiki.apache.org/confluence/display/IGNITE/How+to+Contribute)
   - [Coding abbreviation rules](https://cwiki.apache.org/confluence/display/IGNITE/Abbreviation+Rules)
   - [Coding Guidelines](https://cwiki.apache.org/confluence/display/IGNITE/Coding+Guidelines)
   - [Apache Ignite Teamcity Bot](https://cwiki.apache.org/confluence/display/IGNITE/Apache+Ignite+Teamcity+Bot)
   
   If you need any help, please email dev@ignite.apache.org or ask anу advice on http://asf.slack.com _#ignite_ channel.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r526971727



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       We can't get context after deserialization, because we don't know Ignite instance at this stage. I've marked the field as transient and added a check for null to avoid NPE. I think this is the best we can do. The class resolving logic will not work for services with lazy configuration and deployed via deployment SPI, after serialization/deserialization of `ServiceInfo`. But I think it's not such a common case - `ServiceInfo` not serialized by Ignite and serialization of `ServiceInfo` by the user looks strange. I think this class should not be `Serializable` at all.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r534030813



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       Thanks, fixed it, and added a check to the test.
   
   I found one more problem with services using classes deployed by deployment SPI: such services can't be deployed to the joined node. It can be reproduced if we change in `testServiceDeploymentViaDeploymentSpi` from `deployClusterSingleton` to `deployNodeSingleton`. We can't register class in deployment SPI before node starts, so, after new node joins it receives services information from the cluster and tries to start service locally, but can't find deployment SPI classes, so a registration of such services fails. This issue is not related to this thicket. It looks conceptual and I don't have any ideas on how to solve it right now. 
   
   Also, looks like deployment SPI is not supported by the old service processor implementation, so I've reverted my changes related to GridServiceProcessor. I don't know why TC bot visa was green, I've double-checked it manually, and test `testServiceDeploymentViaDeploymentSpi` failed. This issue can be easily fixed, if we copy-paste `copyAndInject` method from the new implementation, but since the old implementation is deprecated I think we can live with these known issues.  
   




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525288216



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -116,15 +125,28 @@ public IgniteUuid serviceId() {
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public Class<? extends Service> serviceClass() {
         if (cfg instanceof LazyServiceConfiguration) {
+            if (srvcCls != null)
+                return srvcCls;
+
             String clsName = ((LazyServiceConfiguration)cfg).serviceClassName();
 
             try {
-                return (Class<? extends Service>)Class.forName(clsName);
+                srvcCls = (Class<? extends Service>)Class.forName(clsName);
+
+                return srvcCls;
             }
             catch (ClassNotFoundException e) {
+                GridDeployment srvcDep = ctx.deploy().getDeployment(clsName);

Review comment:
       It's only one line of code can be reused, I think it's not such a good idea to make a new method to reuse only `ctx.deploy().getDeployment(clsName)`.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525293391



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -116,15 +125,28 @@ public IgniteUuid serviceId() {
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public Class<? extends Service> serviceClass() {
         if (cfg instanceof LazyServiceConfiguration) {
+            if (srvcCls != null)
+                return srvcCls;
+
             String clsName = ((LazyServiceConfiguration)cfg).serviceClassName();
 
             try {
-                return (Class<? extends Service>)Class.forName(clsName);
+                srvcCls = (Class<? extends Service>)Class.forName(clsName);
+
+                return srvcCls;
             }
             catch (ClassNotFoundException e) {
+                GridDeployment srvcDep = ctx.deploy().getDeployment(clsName);

Review comment:
       I didn't mean copy/paste :)
   
   I thought that there is another way to load className.
   
   For example, load and set a className externally (without KernalContext field in `ServiceInfo`).
   Not sure if `IgniteServiceProcessor#copyAndInject` is a suitable place for that or not.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r531131279



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       I've tried to cover the case with statically configured services, which will be received during node joining.
   
   In this case server (not user) will deserialize `ServiceInfo` without calling the new constructor.
   
   Look at:
   https://github.com/apache/ignite/blob/8f824ca5822d4d7d0b9eb12aa726c32a56776bbc/modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java#L350
   
   I think we need a test for this case too.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525284068



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceHotRedeploymentViaDeploymentSpiTest.java
##########
@@ -61,12 +66,6 @@
         return cfg;
     }
 
-    /** */
-    @BeforeClass

Review comment:
       New test added to this class `testServiceDeploymentViaDeploymentSpi` which also relevant to legacy implementation, so I've moved this check to `serviceHotRedeploymentTest` to skip legacy implementation only for `testServiceHotRedeploymentNode` and `testServiceHotRedeploymentThinClient`




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs merged pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs merged pull request #8431:
URL: https://github.com/apache/ignite/pull/8431


   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r534122908



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       Looks like `desc.context(ctx)` should be called here as well:
   1. https://github.com/apache/ignite/blob/1ce95c603e15aa81d665c0be5b2b89466982d0fb/modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java#L389
   
   2. https://github.com/apache/ignite/blob/1ce95c603e15aa81d665c0be5b2b89466982d0fb/modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java#L1519
   
   I'd suggest to introduce a new method:
   ```
       private void registerService(ServiceInfo desc) {
           desc.context(ctx);
           
           registeredServices.put(desc.serviceId(), desc);
       }
   ```
   It'll allow us to not miss such places in future.
   
   What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525295426



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceHotRedeploymentViaDeploymentSpiTest.java
##########
@@ -61,12 +66,6 @@
         return cfg;
     }
 
-    /** */
-    @BeforeClass

Review comment:
       Got it.
   Thank you for your clarification.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525307406



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -116,15 +125,28 @@ public IgniteUuid serviceId() {
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public Class<? extends Service> serviceClass() {
         if (cfg instanceof LazyServiceConfiguration) {
+            if (srvcCls != null)
+                return srvcCls;
+
             String clsName = ((LazyServiceConfiguration)cfg).serviceClassName();
 
             try {
-                return (Class<? extends Service>)Class.forName(clsName);
+                srvcCls = (Class<? extends Service>)Class.forName(clsName);
+
+                return srvcCls;
             }
             catch (ClassNotFoundException e) {
+                GridDeployment srvcDep = ctx.deploy().getDeployment(clsName);

Review comment:
       I've tried to implement class resolving logic in `IgniteServiceProcessor` before `ServiceInfo` constructor and pass it as an argument, but I think it's risky if we fail in `processServicesChangeRequest`, so I've moved class resolving logic to  `ServiceInfo.serviceClass()` method. 




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r530929735



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       We can handle it in `IgniteServiceProcessor` in places where `registeredServices#put`is called.
   Adding to `registeredServices` is the first place when Ignite's node receives `ServiceInfo`
   
   We can introduce a new method:
   ```
   private void registerService(ServiceInfo desc) {
       desc.setContext(ctx);
       registeredServices.put(desc.serviceId(), desc);
   }
   ```
   
   What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r531015895



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       I have missed the point. `ctx` already passed to `ServiceInfo` constructor right before `registeredServices#put`. And this works fine, the only problem will show up if the user will serialize and deserialize `ServiceInfo` items in some circumstances. But this problem is not solved by your proposal either.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525295201



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceHotRedeploymentViaDeploymentSpiTest.java
##########
@@ -61,12 +66,6 @@
         return cfg;
     }
 
-    /** */
-    @BeforeClass

Review comment:
       Got it.
   Thank you for your clarification.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r534122908



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       Looks like `desc.context(ctx)` should be called here as well:
   1. https://github.com/apache/ignite/blob/1ce95c603e15aa81d665c0be5b2b89466982d0fb/modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java#L389
   
   2. https://github.com/apache/ignite/blob/1ce95c603e15aa81d665c0be5b2b89466982d0fb/modules/core/src/main/java/org/apache/ignite/internal/processors/service/IgniteServiceProcessor.java#L1519
   
   I'd suggest to introduce a new method to have a single point oof adding services in `registeredServices` to not miss such places in future.
   ```
       private void registerService(ServiceInfo desc) {
           desc.context(ctx);
           
           registeredServices.put(desc.serviceId(), desc);
       }
   ```
   
   What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525276115



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       `ServiceInfo` is a serializable unit.
   I'm not sure that there is a sense to transfer `GridKernalContext` instance.
   
   Maybe it's better to make the field transient and initialize it after deserialization.
   What do you think?




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525287035



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       Ok, I will fix 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.

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



[GitHub] [ignite] alex-plekhanov commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
alex-plekhanov commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r534194279



##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       Ok, 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.

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



[GitHub] [ignite] daradurvs commented on a change in pull request #8431: IGNITE-13633 Fix ServiceDescriptor.serviceClass failure in case of de…

Posted by GitBox <gi...@apache.org>.
daradurvs commented on a change in pull request #8431:
URL: https://github.com/apache/ignite/pull/8431#discussion_r525269266



##########
File path: modules/core/src/test/java/org/apache/ignite/internal/processors/service/ServiceHotRedeploymentViaDeploymentSpiTest.java
##########
@@ -61,12 +66,6 @@
         return cfg;
     }
 
-    /** */
-    @BeforeClass

Review comment:
       I think that we shouldn't remove this check because this test is relevant only for the new Service Grid implementation.
   We can remove such checks with the legacy SG-processor in future.

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -37,6 +39,9 @@
     /** */
     private static final long serialVersionUID = 0L;
 
+    /** Context. */
+    private final GridKernalContext ctx;

Review comment:
       `ServiceInfo` is a serializable unit.
   I'm not sure that there is a sense to transfer `GridKernalContext` instance.
   
   Maybe it's better to make the field transient and initialize it after deserialization.
   What do you sink?

##########
File path: modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceInfo.java
##########
@@ -116,15 +125,28 @@ public IgniteUuid serviceId() {
     }
 
     /** {@inheritDoc} */
-    @SuppressWarnings("unchecked")
     @Override public Class<? extends Service> serviceClass() {
         if (cfg instanceof LazyServiceConfiguration) {
+            if (srvcCls != null)
+                return srvcCls;
+
             String clsName = ((LazyServiceConfiguration)cfg).serviceClassName();
 
             try {
-                return (Class<? extends Service>)Class.forName(clsName);
+                srvcCls = (Class<? extends Service>)Class.forName(clsName);
+
+                return srvcCls;
             }
             catch (ClassNotFoundException e) {
+                GridDeployment srvcDep = ctx.deploy().getDeployment(clsName);

Review comment:
       We have similar logic here `IgniteServiceProcessor#copyAndInject`
   
   Can't we reuse 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.

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