eye-gu opened a new issue, #5712: URL: https://github.com/apache/shenyu/issues/5712
### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior <img width="775" alt="image" src="https://github.com/user-attachments/assets/6f0449e4-6f8e-44ab-bffd-63b908916c37"> If you want to create non singleton objects through the SPI mechanism, there may be bugs in multi-threaded scenarios. At positions 1 and 2 of the code, it is hoped that the first thread will remove at position 1 first, and the 'objectHolder' obtained by the second thread will be another instance. But if the first thread has not been removed yet and the second thread obtains the same 'objectHolder' instance with a non empty value, then the two threads obtaining the same instance object violates the non singleton goal 如果要通过spi机制创建非singleton的对象, 多线程场景下会存在bug. 代码的1和2处, 希望是第一个线程先在1处remove, 第二个线程获取的`objectHolder`就是另一个实例. 但可能第一个线程还没remove, 第二个线程拿到相同的`objectHolder`实例, 并且value不为空, 那么两个线程拿到相同的instance对象, 违背了非singleton的目标 ### Expected Behavior _No response_ ### Steps To Reproduce _No response_ ### Environment ```markdown ShenYu version(s): master ``` ### Debug logs _No response_ ### Anything else? _No response_ -- 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: notifications-unsubscr...@shenyu.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org