Comments (4)
Pinging @elastic/es-data-management (Team:Data Management)
from elasticsearch.
It looks like assertBusy didn't fix #44997.
from elasticsearch.
I can reproduce this 100% of the time in the debugger by just putting a breakpoint on the final int currentCount2 = triggerCount.get();
line. Immediately after that line, triggerCount
is incremented in this block:
trigger.set(e -> {
triggeredJobs.add(e.getJobName());
triggerCount.incrementAndGet();
});
from elasticsearch.
I think we have a race condition, and I think the failing assertion is just invalid because we don't want to fix this race condition. Here's the relevant code, with comments added:
final int currentCount2 = triggerCount.get(); // At this point we get the number of jobs. Say it's 2.
previousState = state;
// Create a state simulating the policy being deleted
state = createState(
new SnapshotLifecycleMetadata(Collections.emptyMap(), OperationMode.RUNNING, new SnapshotLifecycleStats()),
true
);
event = new ClusterChangedEvent("5", state, previousState);
sls.clusterChanged(event); // At this point, we cancel any future jobs. But it is entirely possible that a job has run between the first line above and this one. So now triggerCount could be 3 (or even more)
clock.fastForwardSeconds(2);
// The existing job should be cancelled and no longer trigger
assertBusy(() -> assertThat(triggerCount.get(), equalTo(currentCount2))); // If the race condition happened, this will never be true
I don't think we want any additional locking, or to change SchedulerEngine$ActiveSchedule.cancel() to set a flag that listeners need to check, because it's not worth the complexity or risk. I think we just need to accept that sometimes triggerCount
might be greater than currentCount2
.
from elasticsearch.
Related Issues (20)
- [ESQL] Support Date Diff function on date nanos HOT 1
- [ESQL] Support Date Extract function on date nanos HOT 1
- [ESQL] Support Max & Min aggregation on Date Nanos HOT 1
- [ESQL] Support Count & Count Distinct aggregations on date nanos HOT 1
- [ESQL] Support Values aggregation on date nanos HOT 1
- [ESQL] Date Trunc function should support date nanos HOT 1
- [ESQL] Support autocasting to resolve types between nanosecond dates and millisecond dates HOT 1
- Support `major.minor` tag in docker images HOT 5
- [CI] NativePrivilegeStoreCacheTests testPopulationOfCacheWhenLoadingPrivilegesForAllApplications failing HOT 1
- About Elasticsearch License HOT 2
- [CI] IndexRecoveryIT testSourceThrottling failing HOT 1
- [ES|QL][Named parameters] Not sending the params in a query with named parameters results in blocking all future _query requests HOT 2
- [CI] LangPainlessClientYamlTestSuiteIT test {yaml=painless/140_dense_vector_basic/Test hamming distance fails on float} failing HOT 1
- [CI] RolloverIT testRolloverWithClosedWriteIndex failing HOT 3
- Support synthetic source for fields with copy_to feature enabled HOT 1
- Support synthetic source for fields with normalizers enabled HOT 1
- ESQL: a second `ENRICH` enriching with a `RENAME`d field fails HOT 1
- [CI] DataStreamsClientYamlTestSuiteIT test {p0=data_stream/200_rollover_failure_store/Rolling over a failure store on a data stream without the failure store enabled should work} failing HOT 2
- [CI] JvmCrashIT testJvmCrash failing HOT 5
- Improve zero_terms_query option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elasticsearch.