Skip to content

Commit ddd47fa

Browse files
committed
remove system property value set numDirectArenas
Signed-off-by: Rishabh Maurya <[email protected]>
1 parent 70b7c01 commit ddd47fa

File tree

3 files changed

+8
-20
lines changed

3 files changed

+8
-20
lines changed

CHANGELOG-3.0.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1717
- Added pull-based Ingestion (APIs, for ingestion source, a Kafka plugin, and IngestionEngine that pulls data from the ingestion source) ([#16958](https://github.com/opensearch-project/OpenSearch/pull/16958))
1818
- Added ConfigurationUtils to core for the ease of configuration parsing [#17223](https://github.com/opensearch-project/OpenSearch/pull/17223)
1919
- Add execution_hint to cardinality aggregator request (#[17312](https://github.com/opensearch-project/OpenSearch/pull/17312))
20-
- Arrow Flight RPC plugin with Flight server bootstrap logic and client for internode communication support ([#16962](https://github.com/opensearch-project/OpenSearch/pull/16962))
20+
- Arrow Flight RPC plugin with Flight server bootstrap logic and client for internode communication ([#16962](https://github.com/opensearch-project/OpenSearch/pull/16962))
2121

2222
### Dependencies
2323
- Update Apache Lucene to 10.1.0 ([#16366](https://github.com/opensearch-project/OpenSearch/pull/16366))

plugins/arrow-flight-rpc/build.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ tasks.named('test').configure {
7777
}
7878

7979
test {
80+
systemProperty 'io.netty.allocator.numDirectArenas', '1'
8081
systemProperty 'io.netty.noUnsafe', 'false'
8182
systemProperty 'io.netty.tryUnsafe', 'true'
8283
systemProperty 'io.netty.tryReflectionSetAccessible', 'true'
8384
}
8485

8586
internalClusterTest {
87+
systemProperty 'io.netty.allocator.numDirectArenas', '1'
8688
systemProperty 'io.netty.noUnsafe', 'false'
8789
systemProperty 'io.netty.tryUnsafe', 'true'
8890
systemProperty 'io.netty.tryReflectionSetAccessible', 'true'

plugins/arrow-flight-rpc/src/main/java/org/opensearch/arrow/flight/bootstrap/ServerConfig.java

+5-19
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import org.opensearch.common.settings.Setting;
1313
import org.opensearch.common.settings.Settings;
1414
import org.opensearch.common.unit.TimeValue;
15+
import org.opensearch.common.util.concurrent.OpenSearchExecutors;
1516
import org.opensearch.threadpool.ScalingExecutorBuilder;
1617

1718
import java.security.AccessController;
@@ -29,7 +30,6 @@
2930
import io.netty.channel.nio.NioEventLoopGroup;
3031
import io.netty.channel.socket.nio.NioServerSocketChannel;
3132
import io.netty.channel.socket.nio.NioSocketChannel;
32-
import io.netty.util.concurrent.DefaultThreadFactory;
3333

3434
/**
3535
* Configuration class for OpenSearch Flight server settings.
@@ -172,18 +172,14 @@ public static List<Setting<?>> getSettings() {
172172
ARROW_ENABLE_UNSAFE_MEMORY_ACCESS,
173173
ARROW_SSL_ENABLE
174174
)
175-
) {
176-
{
177-
addAll(Netty4Configs.getSettings());
178-
}
179-
};
175+
);
180176
}
181177

182178
static EventLoopGroup createELG(String name, int eventLoopThreads) {
183179

184180
return Epoll.isAvailable()
185-
? new EpollEventLoopGroup(eventLoopThreads, new DefaultThreadFactory(name, true))
186-
: new NioEventLoopGroup(eventLoopThreads, new DefaultThreadFactory(name, true));
181+
? new EpollEventLoopGroup(eventLoopThreads, OpenSearchExecutors.daemonThreadFactory(name))
182+
: new NioEventLoopGroup(eventLoopThreads, OpenSearchExecutors.daemonThreadFactory(name));
187183
}
188184

189185
static Class<? extends Channel> serverChannelType() {
@@ -195,16 +191,10 @@ static Class<? extends Channel> clientChannelType() {
195191
}
196192

197193
private static class Netty4Configs {
198-
public static final Setting<Integer> NETTY_ALLOCATOR_NUM_DIRECT_ARENAS = Setting.intSetting(
199-
"io.netty.allocator.numDirectArenas",
200-
1, // TODO - 2 * the number of available processors; to be confirmed and set after running benchmarks
201-
1,
202-
Setting.Property.NodeScope
203-
);
204194

205195
@SuppressForbidden(reason = "required for netty allocator configuration")
206196
public static void init(Settings settings) {
207-
System.setProperty("io.netty.allocator.numDirectArenas", Integer.toString(NETTY_ALLOCATOR_NUM_DIRECT_ARENAS.get(settings)));
197+
checkSystemProperty("io.netty.allocator.numDirectArenas", "1");
208198
checkSystemProperty("io.netty.noUnsafe", "false");
209199
checkSystemProperty("io.netty.tryUnsafe", "true");
210200
checkSystemProperty("io.netty.tryReflectionSetAccessible", "true");
@@ -224,9 +214,5 @@ private static void checkSystemProperty(String propertyName, String expectedValu
224214
);
225215
}
226216
}
227-
228-
public static List<Setting<?>> getSettings() {
229-
return List.of(NETTY_ALLOCATOR_NUM_DIRECT_ARENAS);
230-
}
231217
}
232218
}

0 commit comments

Comments
 (0)