Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
c753c31
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 6, 2025
7589b39
Merge upstream/main and FeatureRequest18674
Aug 6, 2025
4463d5a
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 7, 2025
e287c6f
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 9, 2025
875221e
[Feature Request] Add support for a ForkJoinPool type - Add changelog…
Aug 10, 2025
ddf3d9d
[Feature Request] Add support for a ForkJoinPool type - Add changelog…
Aug 10, 2025
e8e2e83
Add support for a ForkJoinPool type - spotlessApply
Aug 10, 2025
f96fd0e
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 10, 2025
5df90f6
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 10, 2025
0d508b6
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
30024e3
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
71e254c
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
c73c4d5
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
cb433f8
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
c1fa79c
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
71aaad9
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
c4781ba
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
0fbd1c2
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 11, 2025
0a683f7
Initial chekpoint Feature Request - Add support for a ForkJoinPool type
Aug 11, 2025
6b95c1b
Merge the upstream into my main
Aug 13, 2025
e235dd6
Add few more tests to cover the code
Aug 13, 2025
b42af66
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 14, 2025
fd10363
Add few more tests to cover the code
Aug 14, 2025
8b8225a
Backward Compatibility : fallback to FIXED for unknown types
Aug 14, 2025
24cbd53
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 15, 2025
ba4ab4d
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 15, 2025
ffacad4
Backward Compatibility : fallback to FIXED for unknown types
Aug 15, 2025
d73c0be
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 18, 2025
c053c6a
Backward Compatibility : fallback to FIXED for unknown types
Aug 18, 2025
6630cbc
Backward Compatibility : fallback to FIXED for unknown types
Aug 18, 2025
c6914ca
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 21, 2025
0315fb6
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Aug 26, 2025
7b813db
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 2, 2025
7f43e51
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 15, 2025
c9c9995
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 15, 2025
698a95e
Addressed the PR comments
Sep 15, 2025
4877c83
Apply spotlesscheck
Sep 18, 2025
49ac561
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 18, 2025
1b93311
Apply spotlesscheck and merge new changes to my main branch
Sep 18, 2025
009edeb
Apply spotlesscheck and merge new changes to my main branch
Sep 18, 2025
8949ccc
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 20, 2025
d60a5e5
Remove the allowlist and the registration method.
Sep 20, 2025
71f5d1f
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 23, 2025
71322fa
Address the PR comments for the awaitTermination in threadpool
Sep 23, 2025
38377d2
Address the PR comments for the awaitTermination in threadpool
Sep 23, 2025
17a731d
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 23, 2025
45cfd37
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 23, 2025
d3fc1d8
Addressed the PR comments
Sep 23, 2025
f30ed0d
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 23, 2025
5850f98
Address the PR comments
Sep 23, 2025
68098e7
Address the PR comments
Sep 23, 2025
60c699f
Address the PR comments
Sep 23, 2025
d25f0c4
Address the PR comments
Sep 23, 2025
384e750
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 23, 2025
cb89bdd
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 24, 2025
ce6c139
Address the PR comments
Sep 24, 2025
779be1d
Address the PR comments
Sep 24, 2025
4ad3782
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 25, 2025
9e36824
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Sep 25, 2025
5658e9f
Address the PR comments for Yaml tests
Sep 25, 2025
b9c706f
Address the PR comments for Yaml tests
Sep 26, 2025
f4fadbc
Address the PR comments for Yaml tests
Sep 26, 2025
eb7d36c
Address the PR comments for Yaml tests
Sep 26, 2025
d116df7
Address the PR comments for Yaml tests
Sep 26, 2025
cfd900f
Address the PR comments for Yaml tests
Sep 26, 2025
4fba6a7
Address the PR comments for Yaml tests
Sep 26, 2025
1fea0fc
Address the PR comments for Yaml tests
Sep 26, 2025
bfa2030
Address the PR comments for Yaml tests
Sep 26, 2025
a8b75be
Address the PR comments for Yaml tests
Sep 26, 2025
5aeeec4
Address the PR comments for Yaml tests
Sep 26, 2025
244ed19
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 5, 2025
4d647c3
Address code review comments
Oct 5, 2025
6075fe7
Address code review comments
Oct 6, 2025
0736ed4
Address code review comments
Oct 6, 2025
c9a42d3
Address code review comments
Oct 6, 2025
85daa06
Address code review comments
Oct 6, 2025
3e37fc3
Address code review comments
Oct 6, 2025
af44937
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 6, 2025
cd7e77d
Merging upstream main to my main
Oct 9, 2025
f9698e7
Resolve merge conflicts
Oct 9, 2025
8259f2a
Introduce new settings in ForkJoinPoolExecutorBuilder
Oct 9, 2025
2578f2d
overload the constructor and keep the existing version for compatibil…
Oct 9, 2025
0dad905
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 9, 2025
bf2f8d4
Fix the precommit failure issues
Oct 9, 2025
e95f41e
Fix the precommit failure issues
Oct 9, 2025
c56a05d
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 10, 2025
f15d508
Fix the test failures for queue size
Oct 10, 2025
856e7d5
Fix the test failures for queue size
Oct 10, 2025
e069acb
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 14, 2025
47e8b44
Added tests
Oct 14, 2025
251bc9f
Merge branch 'main' into main
srikanthpadakanti Oct 15, 2025
efcafd1
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 15, 2025
2238404
Added tests for the codecoverage target
Oct 15, 2025
6d5db6f
Changed te scope of buildTable and removed reflection
Oct 16, 2025
c9762f5
Changed te scope of buildTable and removed reflection
Oct 16, 2025
9e52fcd
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 16, 2025
5f55cd9
Changed the IT from plugin folder to single node IT with inline plugi…
Oct 16, 2025
1d64dba
Changed the IT from plugin folder to single node IT with inline plugi…
Oct 16, 2025
ab0a165
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 16, 2025
ca3f389
Changed the IT from plugin folder to single node IT with inline plugi…
Oct 16, 2025
f0ef745
Merge branch 'opensearch-project:main' into main
srikanthpadakanti Oct 17, 2025
22a1086
Removed the build.gradle dependency opensearch-common
Oct 17, 2025
0511a4a
Removed the build.gradle dependency opensearch-common
Oct 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased 3.x]
### Added

- Add support for a ForkJoinPool type ([#19008](https://github.com/opensearch-project/OpenSearch/pull/19008))
- Add seperate shard limit validation for local and remote indices ([#19532](https://github.com/opensearch-project/OpenSearch/pull/19532))
- Use Lucene `pack` method for `half_float` and `usigned_long` when using `ApproximatePointRangeQuery`.
- Add a mapper for context aware segments grouping criteria ([#19233](https://github.com/opensearch-project/OpenSearch/pull/19233))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.ForkJoinPool;

import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Consumer;

Expand All @@ -70,6 +72,11 @@ public void tearDownThreadPool() {

public void testExecutionErrorOnDefaultThreadPoolTypes() throws InterruptedException {
for (String executor : ThreadPool.THREAD_POOL_TYPES.keySet()) {
// ForkJoinPool is skipped here because it does not support all ThreadPoolExecutor features or APIs,
// and is tested separately in testExecutionErrorOnForkJoinPool.
if (ThreadPool.THREAD_POOL_TYPES.get(executor) == ThreadPool.ThreadPoolType.FORK_JOIN) {
continue; // skip FORK_JOIN for these tests
}
checkExecutionError(getExecuteRunner(threadPool.executor(executor)));
checkExecutionError(getSubmitRunner(threadPool.executor(executor)));
checkExecutionError(getScheduleRunner(executor));
Expand Down Expand Up @@ -176,6 +183,11 @@ protected void doRun() {

public void testExecutionExceptionOnDefaultThreadPoolTypes() throws InterruptedException {
for (String executor : ThreadPool.THREAD_POOL_TYPES.keySet()) {
// ForkJoinPool is skipped here because it does not support all ThreadPoolExecutor features or APIs,
// and is tested separately in testExecutionErrorOnForkJoinPool.
if (ThreadPool.THREAD_POOL_TYPES.get(executor) == ThreadPool.ThreadPoolType.FORK_JOIN) {
continue; // skip FORK_JOIN for these tests
}
checkExecutionException(getExecuteRunner(threadPool.executor(executor)), true);

// here, it's ok for the exception not to bubble up. Accessing the future will yield the exception
Expand Down Expand Up @@ -391,4 +403,43 @@ private void runExecutionTest(
}
}

public void testExecutionExceptionOnForkJoinPool() throws InterruptedException {
ForkJoinPool fjp = new ForkJoinPool();
try {
checkExecutionException(getExecuteRunner(fjp), true);
checkExecutionException(getSubmitRunner(fjp), false);
} finally {
fjp.shutdownNow();
fjp.awaitTermination(10, TimeUnit.SECONDS);
}
}

public void testExecutionErrorOnForkJoinPool() throws Exception {
ForkJoinPool fjp = new ForkJoinPool(8);
final CountDownLatch latch = new CountDownLatch(1);
final AtomicReference<Throwable> thrown = new AtomicReference<>();
try {
fjp.execute(() -> {
try {
throw new Error("future error");
} catch (Throwable t) {
thrown.set(t);
} finally {
latch.countDown();
}
});

// Wait up to 5 seconds for the task to complete
assertTrue("Timeout waiting for ForkJoinPool task", latch.await(5, TimeUnit.SECONDS));

Throwable error = thrown.get();
assertNotNull("No error captured from ForkJoinPool task", error);
assertTrue(error instanceof Error);
assertEquals("future error", error.getMessage());
} finally {
fjp.shutdownNow();
fjp.awaitTermination(10, TimeUnit.SECONDS);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -60,72 +60,72 @@

- match:
$body: |
/ #node_name name active queue rejected
^ (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/
/ #node_name name active queue rejected
^ (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/

- do:
cat.thread_pool:
v: true
v: true

- match:
$body: |
/^ node_name \s+ name \s+ active \s+ queue \s+ rejected \n
(\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/
$body: |
/^ node_name \s+ name \s+ active \s+ queue \s+ rejected \n
(\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/

- do:
cat.thread_pool:
h: pid,id,h,i,po
h: pid,id,h,i,po

- match:
$body: |
/ #pid id host ip port
(\d+ \s+ \S+ \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ (\d+|-) \n)+ $/
/ #pid id host ip port
(\d+ \s+ \S+ \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ (\d+|-) \n)+ $/

- do:
cat.thread_pool:
thread_pool_patterns: write,management,flush,generic,force_merge
h: id,name,active
v: true
thread_pool_patterns: write,management,flush,generic,force_merge
h: id,name,active
v: true

- match:
$body: |
/^ id \s+ name \s+ active \n
(\S+\s+ flush \s+ \d+ \n
\S+\s+ force_merge \s+ \d+ \n
\S+\s+ generic \s+ \d+ \n
\S+\s+ management \s+ \d+ \n
\S+\s+ write \s+ \d+ \n)+ $/
/^ id \s+ name \s+ active \n
(\S+\s+ flush \s+ \d+ \n
\S+\s+ force_merge \s+ \d+ \n
\S+\s+ generic \s+ \d+ \n
\S+\s+ management \s+ \d+ \n
\S+\s+ write \s+ \d+ \n)+ $/

- do:
cat.thread_pool:
thread_pool_patterns: write
h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive
v: true
thread_pool_patterns: write
h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive
v: true

- match:
$body: |
/^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ max \s+ keep_alive \n
(\S+ \s+ write \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \S* \n)+ $/
/^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ max \s+ keep_alive \n
(\S+ \s+ write \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \S* \n)+ $/

- do:
cat.thread_pool:
thread_pool_patterns: fetch*
h: id,name,type,active,pool_size,queue,queue_size,rejected,largest,completed,core,max,size,keep_alive
v: true
thread_pool_patterns: fetch*
h: id,name,type,active,pool_size,queue,queue_size,rejected,largest,completed,core,max,size,keep_alive
v: true

- match:
$body: |
/^ id \s+ name \s+ type \s+ active \s+ pool_size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ core \s+ max \s+ size \s+ keep_alive \n
(\S+ \s+ fetch_shard_started \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n
\S+ \s+ fetch_shard_store \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n)+ $/
/^ id \s+ name \s+ type \s+ active \s+ pool_size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ core \s+ max \s+ size \s+ keep_alive \n
(\S+ \s+ fetch_shard_started \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n
\S+ \s+ fetch_shard_store \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ (-1|\d+) \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \d* \s+ \S* \n)+ $/

- do:
cat.thread_pool:
thread_pool_patterns: write,search
size: ""
thread_pool_patterns: write,search
size: ""

- match:
$body: |
/ #node_name name active queue rejected
^ (\S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n
\S+ \s+ write \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/
/ #node_name name active queue rejected
^ (\S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n
\S+ \s+ write \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* The OpenSearch Contributors require contributions made to
* this file be licensed under the Apache-2.0 license or a
* compatible open source license.
*/

package org.opensearch.threadpool;

import org.opensearch.common.settings.Settings;
import org.opensearch.plugins.Plugin;
import org.opensearch.test.OpenSearchSingleNodeTestCase;

import java.util.Collection;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

/**
* Single-node IT that defines an inline plugin to register a ForkJoin executor ("jvector")
* and verifies it is available on the node.
*/
public class ForkJoinPoolIT extends OpenSearchSingleNodeTestCase {

/**
* Inline test plugin that registers a ForkJoin-based executor named "jvector"
* with a fixed parallelism of 9 for deterministic assertions.
*/
public static class TestPlugin extends Plugin {
@Override
public List<ExecutorBuilder<?>> getExecutorBuilders(final Settings settings) {
return List.of(new ForkJoinPoolExecutorBuilder("jvector", 9));
}
}

@Override
protected Collection<Class<? extends Plugin>> getPlugins() {
// Load the inline plugin into the single-node cluster for this test
return List.of(TestPlugin.class);
}

public void testForkJoinPoolExists() {
// Obtain the node's ThreadPool and verify the "jvector" executor
ThreadPool threadPool = getInstanceFromNode(ThreadPool.class);
ExecutorService executor = threadPool.executor("jvector");
assertNotNull("jvector executor should be registered by the test plugin", executor);
assertTrue("jvector should be a ForkJoinPool", executor instanceof ForkJoinPool);
assertEquals("parallelism should be 9", 9, ((ForkJoinPool) executor).getParallelism());

// Also validate ThreadPool.Info reports FORK_JOIN with expected parallelism (max)
ThreadPool.Info info = threadPool.info("jvector");
assertNotNull("ThreadPool.Info for jvector should exist", info);
assertEquals("jvector", info.getName());
assertEquals("type must be FORK_JOIN", ThreadPool.ThreadPoolType.FORK_JOIN, info.getThreadPoolType());
assertEquals("info.max should equal parallelism", 9, info.getMax());
}
}
Loading
Loading