Skip to content

Prevent duplicate Feature Flagging runtimes - #12250

Draft
leoromanovsky wants to merge 2 commits into
masterfrom
leo.romanovsky/openfeature-runtime-core
Draft

Prevent duplicate Feature Flagging runtimes#12250
leoromanovsky wants to merge 2 commits into
masterfrom
leo.romanovsky/openfeature-runtime-core

Conversation

@leoromanovsky

Copy link
Copy Markdown
Contributor

Motivation

Java Feature Flags is gaining two supported installation surfaces: a standalone dd-openfeature runtime and an agent-integrated runtime used by SSI. Without explicit process-wide ownership, both surfaces can start configuration polling and event delivery in the same JVM, producing duplicate requests and duplicate telemetry for customers who combine the library with the Java agent.

Changes

The Feature Flagging gateway now records which runtime owns configuration and event delivery. Claims are exclusive and idempotent for the current owner. The agent system claims ownership immediately before initialization and releases it during shutdown, while declining to start when the standalone runtime already owns the process.

The focused gateway and agent-system tests cover exclusive claims, idempotency, release behavior, and the agentless activation path when standalone ownership already exists.

Decisions

Ownership lives in the bootstrap gateway because it is the one process-wide object shared by the provider and agent integration. This PR intentionally does not add the standalone runtime yet; it establishes the invariant needed by the next PR in the stack. A runtime may retry its own claim, but a different runtime cannot replace the active owner.

Validation: ./gradlew :products:feature-flagging:feature-flagging-bootstrap:test :products:feature-flagging:feature-flagging-agent:test :products:feature-flagging:feature-flagging-bootstrap:spotlessCheck :products:feature-flagging:feature-flagging-agent:spotlessCheck

Claim process-wide ownership before starting configuration polling and event delivery so future standalone and injected modes cannot run concurrently.
@leoromanovsky leoromanovsky added comp: openfeature OpenFeature type: feature Enhancements and improvements tag: no release notes Changes to exclude from release notes tag: ai generated Largely based on code generated by an AI or LLM labels Aug 20, 2026 — with ddtool CLI
@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 78.42% (+19.82%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 9a0f9fb | Docs | View more details | Give us feedback!

@dd-octo-sts

dd-octo-sts Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

🟢 Java Benchmark SLOs — All performance SLOs passed

Suite Status
Startup 🟢 pass

SLO thresholds are defined here based on automatically generated metrics. A warning is raised when results are within 5% of the threshold.

PR vs. master results
Scenario Candidate master Δ (95% CI of mean)
startup:insecure-bank:iast:Agent 14.00 s 13.86 s [+0.3%; +1.8%] (maybe worse)
startup:insecure-bank:tracing:Agent 12.87 s 13.04 s [-2.1%; -0.6%] (maybe better)
startup:petclinic:appsec:Agent 16.42 s 16.80 s [-6.4%; +1.9%] (no difference)
startup:petclinic:iast:Agent 16.96 s 17.06 s [-1.5%; +0.3%] (no difference)
startup:petclinic:profiling:Agent 16.70 s 16.90 s [-2.2%; -0.1%] (maybe better)
startup:petclinic:sca:Agent 16.69 s 16.60 s [-0.5%; +1.6%] (no difference)
startup:petclinic:tracing:Agent 16.22 s 16.11 s [-0.4%; +1.6%] (no difference)

Commit: 9a0f9fbe · CI Pipeline · Benchmarking Platform UI


Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion.

Attempt the atomic ownership transition before checking idempotency so the runtime claim behavior remains race-safe and fully covered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp: openfeature OpenFeature tag: ai generated Largely based on code generated by an AI or LLM tag: no release notes Changes to exclude from release notes type: feature Enhancements and improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant