wu-sheng commented on a change in pull request #2962: Allow alarm rules and 
webhooks to be dynamically configured
URL: https://github.com/apache/skywalking/pull/2962#discussion_r298816673
 
 

 ##########
 File path: 
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/AlarmModuleProvider.java
 ##########
 @@ -49,19 +53,26 @@
         }
         RulesReader reader = new RulesReader(applicationReader);
         Rules rules = reader.readRules();
+        alarmRulesWatcher = new AlarmRulesWatcher(rules, this, this::reload);
+    }
+
+    private void reload(final Rules rules) {
 
 Review comment:
   This `reload` is a hijack to existing code. 
`ModuleProvider#registerServiceImplementation` didn't expect runtime change in 
the design. So you could see `Map<Class<? extends Service>, Service> services` 
for service register, which is not thread-safe.
   
   We need to reconsider this, even whether do we need to approve the service 
hot-switch 

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


With regards,
Apache Git Services

Reply via email to