This is an automated email from the ASF dual-hosted git repository.
Aias00 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git
The following commit(s) were added to refs/heads/master by this push:
new a14fb62f1d fix(web): synchronize external plugin updates (#7109)
a14fb62f1d is described below
commit a14fb62f1dcf73a596f3a744f4d422596ad4c2f6
Author: Liming Deng <[email protected]>
AuthorDate: Wed Sep 23 13:13:33 2026 +0800
fix(web): synchronize external plugin updates (#7109)
Co-authored-by: aias00 <[email protected]>
---
.../main/java/org/apache/shenyu/web/handler/ShenyuWebHandler.java | 2 +-
.../java/org/apache/shenyu/web/handler/ShenyuWebHandlerTest.java | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git
a/shenyu-web/src/main/java/org/apache/shenyu/web/handler/ShenyuWebHandler.java
b/shenyu-web/src/main/java/org/apache/shenyu/web/handler/ShenyuWebHandler.java
index 460d113f92..3bb84adcfc 100644
---
a/shenyu-web/src/main/java/org/apache/shenyu/web/handler/ShenyuWebHandler.java
+++
b/shenyu-web/src/main/java/org/apache/shenyu/web/handler/ShenyuWebHandler.java
@@ -147,7 +147,7 @@ public final class ShenyuWebHandler implements WebHandler,
ApplicationListener<P
*
* @param extPlugins the ext plugins
*/
- public void putExtPlugins(final List<ShenyuPlugin> extPlugins) {
+ public synchronized void putExtPlugins(final List<ShenyuPlugin>
extPlugins) {
if (CollectionUtils.isEmpty(extPlugins)) {
return;
}
diff --git
a/shenyu-web/src/test/java/org/apache/shenyu/web/handler/ShenyuWebHandlerTest.java
b/shenyu-web/src/test/java/org/apache/shenyu/web/handler/ShenyuWebHandlerTest.java
index bc720c905f..2b366f22cf 100644
---
a/shenyu-web/src/test/java/org/apache/shenyu/web/handler/ShenyuWebHandlerTest.java
+++
b/shenyu-web/src/test/java/org/apache/shenyu/web/handler/ShenyuWebHandlerTest.java
@@ -39,6 +39,7 @@ import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
+import java.lang.reflect.Modifier;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.Collections;
@@ -94,6 +95,11 @@ public final class ShenyuWebHandlerTest {
shenyuWebHandler.putExtPlugins(Collections.singletonList(new
TestPlugin3()));
}
+ @Test
+ public void putExtPluginsIsSynchronized() throws NoSuchMethodException {
+
assertTrue(Modifier.isSynchronized(ShenyuWebHandler.class.getMethod("putExtPlugins",
List.class).getModifiers()));
+ }
+
@Test
public void scheduledEnableTest() {
final ServerWebExchange exchange =
MockServerWebExchange.from(MockServerHttpRequest.get("localhost")