Skip to content

Ensure DLM only runs one general loop at a time#143883

Merged
dakrone merged 5 commits intoelastic:mainfrom
dakrone:only-run-dlm-execution-once
Mar 10, 2026
Merged

Ensure DLM only runs one general loop at a time#143883
dakrone merged 5 commits intoelastic:mainfrom
dakrone:only-run-dlm-execution-once

Conversation

@dakrone
Copy link
Copy Markdown
Member

@dakrone dakrone commented Mar 9, 2026

Since DLM only runs at an interval, we'd like a second triggering of the schedule not to run DLM again, so that we can limit the overhead of DLM an avoid concurrent running issues. This commit adds a "currently running" flag that protects DLM from being run concurrently on short schedules.

Since DLM only runs at an interval, we'd like a second triggering of the schedule not to run DLM
again, so that we can limit the overhead of DLM an avoid concurrent running issues. This commit adds
a "currently running" flag that protects DLM from being run concurrently on short schedules.
@dakrone dakrone added >enhancement :StorageEngine/Data streams Data streams and their lifecycles v9.4.0 labels Mar 9, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @dakrone, I've created a changelog YAML for you.

@dakrone dakrone marked this pull request as ready for review March 9, 2026 19:15
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Copy Markdown
Contributor

@seanzatzdev seanzatzdev left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for working on this

@lukewhiting
Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: ac21a5f4-f901-43a6-9bfd-6dd16137f16a

📥 Commits

Reviewing files that changed from the base of the PR and between c995a17 and b4da58a.

📒 Files selected for processing (3)
  • docs/changelog/143883.yaml
  • modules/data-streams/src/main/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleService.java
  • modules/data-streams/src/test/java/org/elasticsearch/datastreams/lifecycle/DataStreamLifecycleServiceTests.java

📝 Walkthrough

Walkthrough

This pull request adds concurrency protection to the Data Stream Lifecycle Manager (DLM) service. The DataStreamLifecycleService.run method now uses an AtomicBoolean flag to ensure only one execution runs simultaneously. If a run is already in progress, the invocation exits with a debug log. Exception handling is enhanced per-project to prevent single failures from terminating the entire run. A new test validates this single-run-at-a-time behavior using latches to coordinate concurrent thread execution. A changelog entry documents this enhancement.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@lukewhiting lukewhiting left a comment

Choose a reason for hiding this comment

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

LGMT 👍🏻

@dakrone dakrone merged commit 2dabfb3 into elastic:main Mar 10, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants