Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure cached time elapses in ClusterServiceIT #91986

Merged

Conversation

DaveCTurner
Copy link
Contributor

Rather than just checking System.nanoTime() we should verify that each thread pool's cached time has elapsed here.

Rather than just checking `System.nanoTime()` we should verify that each
thread pool's cached time has elapsed here.
@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. v8.7.0 labels Nov 29, 2022
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed (Team:Distributed)

@elasticsearchmachine elasticsearchmachine added the Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. label Nov 29, 2022
@DaveCTurner
Copy link
Contributor Author

Possibly this doesn't matter in main today but it explains a failure I encountered on #85751.

@DaveCTurner DaveCTurner requested a review from kingherc November 29, 2022 17:30
@DaveCTurner
Copy link
Contributor Author

Relates #90397


outer: do {
for (int i = 0; i < threadPools.length; i++) {
if (threadPools[i].relativeTimeInMillis() <= startTimes[i]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it even possible that the relativeTimeInMillis() for a threadpool could become less than when you recorded its start time above?

Copy link
Contributor Author

@DaveCTurner DaveCTurner Nov 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It certainly shouldn't go backwards, no. But that doesn't really matter here, and IMO it'd be kind of weird to say threadPools[i].relativeTimeInMillis() == startTimes[i] in this condition here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I see, so it's sort of a safeguard.


outer: do {
for (int i = 0; i < threadPools.length; i++) {
if (threadPools[i].relativeTimeInMillis() <= startTimes[i]) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK I see, so it's sort of a safeguard.

@DaveCTurner DaveCTurner merged commit 37988dd into elastic:main Nov 30, 2022
@DaveCTurner DaveCTurner deleted the 2022-11-29-ClusterServiceIT-wait branch November 30, 2022 15:03
weizijun added a commit to weizijun/elasticsearch that referenced this pull request Dec 2, 2022
* upstream/main: (209 commits)
  Remove unused methods and classes from HLRC (elastic#92030)
  Clean up on exception while chunking XContent (elastic#92024)
  Add profiling plugin (elastic#91640)
  Remove unused methods and classes from HLRC (elastic#92012)
  Remove IndexerState from HLRC (elastic#92023)
  Ensure cached time elapses in ClusterServiceIT (elastic#91986)
  Chunked encoding for RestGetIndicesAction (elastic#92016)
  Simplify shardsWithState (elastic#91991)
  [DOCS] Updates ML decider docs by mentioning CPU as scaling criterion (elastic#92018)
  Add chunking to ClusterState.Custom impls (elastic#91963)
  Speedup time_series agg by caching current tsid ordinal, parent bucket ordinal and buck ordinal (elastic#91784)
  Drop the ingest listener call count tracking (elastic#92003)
  [DOCS] fixes issue number 91889 - missing [discrete] header (elastic#91976)
  Fix PersistentTasksClusterServiceTests (elastic#92002)
  [docs] Update search-settings documentation to reflect the fact that the indices.query.bool.max_clause_count setting has been deprecated (elastic#91811)
  Clarify writability in Netty4HttpPipeliningHandler (elastic#91982)
  Load stable plugins as synthetic modules (elastic#91869)
  Handle any exception thrown while generating source for an IngestDocument (elastic#91981)
  fixing Apache HttpHost url on java-rest doc (elastic#91945)
  Implement repair functionality for aliases colliding with indices bug (elastic#91887)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed (Obsolete) Meta label for distributed team (obsolete). Replaced by Distributed Indexing/Coordination. >test Issues or PRs that are addressing/adding tests v8.7.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants