Skip to content

Commit 929b4dc

Browse files
committed
Add dummy settings to allow more tests to run
1 parent bb05622 commit 929b4dc

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

server/src/main/java/org/elasticsearch/threadpool/VirtualThreadsExecutorBuilder.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
import org.elasticsearch.common.util.concurrent.EsExecutors;
1616
import org.elasticsearch.common.util.concurrent.ThreadContext;
1717
import org.elasticsearch.core.TimeValue;
18+
import org.elasticsearch.logging.LogManager;
19+
import org.elasticsearch.logging.Logger;
1820
import org.elasticsearch.node.Node;
1921

2022
import java.util.List;
@@ -24,21 +26,37 @@
2426

2527
public class VirtualThreadsExecutorBuilder extends ExecutorBuilder<VirtualThreadsExecutorSettings> {
2628

29+
private static final Logger logger = LogManager.getLogger(VirtualThreadsExecutorBuilder.class);
30+
2731
private final boolean rejectAfterShutdown;
32+
private final List<Setting<?>> registeredSettings;
2833

2934
public VirtualThreadsExecutorBuilder(String name, boolean rejectAfterShutdown) {
3035
super(name, false);
3136
this.rejectAfterShutdown = rejectAfterShutdown;
37+
final String settingsPrefix = "thread_pool." + name + ".";
38+
// Don't apply any of these settings, just define them to make test failures go away
39+
registeredSettings = List.of(
40+
Setting.intSetting(settingsPrefix + "size", 999, 1, Setting.Property.NodeScope),
41+
Setting.intSetting(settingsPrefix + "max", 999, 1, Setting.Property.NodeScope),
42+
Setting.intSetting(settingsPrefix + "core", 999, 0, Setting.Property.NodeScope),
43+
Setting.intSetting(settingsPrefix + "queue_size", 999, Setting.Property.NodeScope)
44+
);
3245
}
3346

3447
@Override
3548
public List<Setting<?>> getRegisteredSettings() {
36-
return List.of();
49+
return registeredSettings;
3750
}
3851

3952
@Override
4053
VirtualThreadsExecutorSettings getSettings(Settings settings) {
4154
final String nodeName = Node.NODE_NAME_SETTING.get(settings);
55+
for (Setting<?> setting : registeredSettings) {
56+
if (setting.exists(settings)) {
57+
logger.warn("Ignoring setting [{}] for virtual thread pool [{}]", setting, name());
58+
}
59+
}
4260
return new VirtualThreadsExecutorSettings(nodeName);
4361
}
4462

0 commit comments

Comments
 (0)