diff --git a/server/src/main/java/org/opensearch/common/network/NetworkModule.java b/server/src/main/java/org/opensearch/common/network/NetworkModule.java index 486fc55e5f58f..821d48fccf48c 100644 --- a/server/src/main/java/org/opensearch/common/network/NetworkModule.java +++ b/server/src/main/java/org/opensearch/common/network/NetworkModule.java @@ -150,11 +150,11 @@ public NetworkModule( HttpServerTransport.Dispatcher dispatcher, ClusterSettings clusterSettings, Tracer tracer, - List coreTransportInterceptors + List transportInterceptors ) { this.settings = settings; - if (coreTransportInterceptors != null) { - coreTransportInterceptors.forEach(this::registerTransportInterceptor); + if (transportInterceptors != null) { + transportInterceptors.forEach(this::registerTransportInterceptor); } for (NetworkPlugin plugin : plugins) { Map> httpTransportFactory = plugin.getHttpTransports( @@ -184,11 +184,11 @@ public NetworkModule( for (Map.Entry> entry : transportFactory.entrySet()) { registerTransport(entry.getKey(), entry.getValue()); } - List transportInterceptors = plugin.getTransportInterceptors( + List pluginTransportInterceptors = plugin.getTransportInterceptors( namedWriteableRegistry, threadPool.getThreadContext() ); - for (TransportInterceptor interceptor : transportInterceptors) { + for (TransportInterceptor interceptor : pluginTransportInterceptors) { registerTransportInterceptor(interceptor); } } diff --git a/server/src/main/java/org/opensearch/node/Node.java b/server/src/main/java/org/opensearch/node/Node.java index 0a7968c87f9eb..2e78f7a14b6c2 100644 --- a/server/src/main/java/org/opensearch/node/Node.java +++ b/server/src/main/java/org/opensearch/node/Node.java @@ -893,7 +893,6 @@ protected Node( final RestController restController = actionModule.getRestController(); - List coreTransportInterceptors = new ArrayList<>(); final AdmissionControlService admissionControlService = new AdmissionControlService( settings, clusterService.getClusterSettings(), @@ -904,7 +903,7 @@ protected Node( admissionControlService ); - coreTransportInterceptors.add(admissionControlTransportInterceptor); + List transportInterceptors = List.of(admissionControlTransportInterceptor); final NetworkModule networkModule = new NetworkModule( settings, pluginsService.filterPlugins(NetworkPlugin.class), @@ -918,7 +917,7 @@ protected Node( restController, clusterService.getClusterSettings(), tracer, - coreTransportInterceptors + transportInterceptors ); Collection>> indexTemplateMetadataUpgraders = pluginsService.filterPlugins(