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:
[email protected]


Reply via email to