DeterministicQueue refactor and enhancement#140151
DeterministicQueue refactor and enhancement#140151elasticsearchmachine merged 34 commits intoelastic:mainfrom
Conversation
Also expand DeterministicTaskQueue
…iency-tests-to-stateless
…iency-tests-to-stateless
Also support waiting for a condition before starting the restart node.
…iency-tests-to-stateless
…iency-tests-to-stateless
…-resiliency-tests-to-stateless
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
| FutureUtils.cancel(cancelledBeforeExecution); | ||
| taskQueue.runAllTasks(); | ||
|
|
||
| assertThat(strings, containsInAnyOrder("runnable", "also runnable", "deferred", "not quite so deferred", "further deferred")); |
There was a problem hiding this comment.
nit: maybe should be a Set<String> if we don't care about the order?
There was a problem hiding this comment.
I meant so that we can just say equals(Set.of(...)) here.
But I think I was confused by the name containsInAnyOrder - not only does this check that the collection contains those items in any order, but also apparently that it only contains those items. TIL. So we were already checking for set equality here.
Shame that these things have to be cast to (Runnable) now. Maybe I prefer it how it was.
There was a problem hiding this comment.
Yeah both contains and containsInAnyOrder are quite confusing names.
I reverted in db8a451
Thanks
DaveCTurner
left a comment
There was a problem hiding this comment.
LGTM still but maybe I prefer how it was...
| FutureUtils.cancel(cancelledBeforeExecution); | ||
| taskQueue.runAllTasks(); | ||
|
|
||
| assertThat(strings, containsInAnyOrder("runnable", "also runnable", "deferred", "not quite so deferred", "further deferred")); |
There was a problem hiding this comment.
I meant so that we can just say equals(Set.of(...)) here.
But I think I was confused by the name containsInAnyOrder - not only does this check that the collection contains those items in any order, but also apparently that it only contains those items. TIL. So we were already checking for set equality here.
Shame that these things have to be cast to (Runnable) now. Maybe I prefer it how it was.
* upstream/main: (191 commits) Overall Decision for Deciders prioritizes THROTTLE (elastic#140237) Apply group by all logic not only to top-level aggregates (elastic#140248) [ES|QL] Refactor MV_UNION and MV_INTERSECTION to use shared set operation helper (elastic#139982) Avoid reading entire bloom filter file on reader open (elastic#139374) Mark bloom filter files for random access (elastic#139375) Ensure that the buffer used for ES93BloomFilterStoredFieldsFormat is zeroed (elastic#139034) Add busy assertion to avoid race condition for testStalledShardMigrationProperlyDetected (elastic#140230) Remove line number check for testTransitiveFindsDeepCallChain (elastic#140228) Allow a slight difference in rescored docs (elastic#139931) Mute org.elasticsearch.xpack.inference.integration.AuthorizationTaskExecutorIT testCreatesEisChatCompletion_DoesNotRemoveEndpointWhenNoLongerAuthorized elastic#138480 Start exchange sink fetchers concurrently (elastic#140196) Allow allocation to replacement target node on vacate completion (elastic#140150) Ignore JNA cleaner threads in SecureHdfsRepositoryAnalysisRestIT (elastic#139925) DeterministicQueue refactor and enhancement (elastic#140151) Always error out if CCS expression shows up when CCS is not supported (elastic#139009) Use IllegalArgumentException over RepositoryException for readonly-repository checks (elastic#140200) Guard promql capabilities in AnalyzerTests (elastic#140232) [Inference API] Fix flaky AuthorizationTaskExecutorIT tests (elastic#139978) Cleaning up exitable vector value impls (elastic#140190) [Inference API] Fix auth exception listener not called bug (elastic#139966) ...
This PR makes following changes to DeterministicTaskQueue 1. Promote the anonymous ThreadPool class to a named inner class, `DeterministicThreadPool`. 2. Fix threadContext preservation for all tasks 3. Add a basic implementation for `ScheduledExecutorService#schedule(Runnable, long, TimeUnit)`. The PR is split from elastic#138333
This PR makes following changes to DeterministicTaskQueue
DeterministicThreadPool.ScheduledExecutorService#schedule(Runnable, long, TimeUnit).The PR is split from #138333