wankai123 commented on issue #11311:
URL: https://github.com/apache/skywalking/issues/11311#issuecomment-1711030777

   try adding a `ReentrantLock` and `BoolFlag` for example:
   ```java
       @Override
       public void notify(ConfigChangeEvent value) {
           lock.lock();
           try {
               if (value.getEventType().equals(EventType.DELETE)) {
                   settingsString = null;
                   notify(new Rules());
               } else {
                   settingsString = value.getNewValue();
                   RulesReader rulesReader = new RulesReader(new 
StringReader(value.getNewValue()));
                   Rules rules = rulesReader.readRules();
                   notify(rules);
               }
               notifiedByDynamicConfig.set(true);
           } finally {
               lock.unlock();
           }
       }
   
       public void notifyBeyondDynamicConfig(Rules newRules) {
           lock.lock();
           try {
               if (notifiedByDynamicConfig.get()) {
                   return;
               }
               notify(newRules);
           } finally {
               lock.unlock();
           }
       }
   ```
   


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

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to