yswdqz commented on PR #9575:
URL: https://github.com/apache/skywalking/pull/9575#issuecomment-1242026343

   I find a bug about `abort{}`.
   If there are 2 lal files : default.yaml and mysql-slowsql.yaml, and they are 
configured by
   ```
   lalFiles: ${SW_LOG_LAL_FILES:mysql-slowsql,default}
   ```
   The default.yaml will load before mysql-slowsql.yaml.
   So if I send a json(layer = "MYSQL") to OAP, it will execute the rule in 
default.yaml first. And default.yaml will execute the abort{} method. And I 
find that the method will also abort the rule in mysql-slowsql.yaml (and other 
rules if exist).
   The abort method is following:
   ```
       protected static final ThreadLocal<Binding> BINDING = 
ThreadLocal.withInitial(Binding::new);
   
       public void abort(final Closure<Void> cl) {
           BINDING.get().abort();
       }
   
       // BINDING.get().abort();
       public Binding abort() {
           setProperty(KEY_ABORT, true);
           return this;
       }
   ```
   The reason of this bug is the BINDING is ThreadLoacal and OAP parse two 
rules in one thread.
   I am confused about how to resolve it. May be we should use multiple threads 
to do these?


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