Skip to content

feat(ffe): add process-wide state and agentless polling - #4196

Draft
pavlokhrebto wants to merge 3 commits into
pavlo.khrebto/FFL-2705/settings-and-endpointfrom
pavlo.khrebto/FFL-2705/process-state-and-agentless-poller
Draft

pavlokhrebto wants to merge 3 commits into
pavlo.khrebto/FFL-2705/settings-and-endpointfrom
pavlo.khrebto/FFL-2705/process-state-and-agentless-poller

Conversation

@pavlokhrebto

@pavlokhrebto pavlokhrebto commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Description

This is the second change in the stacked implementation of agentless Feature Flag Evaluation delivery and is stacked on #4195.

It:

  • replaces thread-local FFE configuration with process-wide, lock-free state, monotonic versions, and explicit delivery-state transitions
  • adds a dedicated agentless polling worker with an immediate first request, fixed post-poll intervals, bounded jittered retries, cancellation, and fork restart seams
  • sends sequential, untraced Hyper requests with proxy support while preventing redirects and concurrent polls
  • supports managed endpoints with DD-API-KEY and custom endpoints with URL-provided Basic authentication, without leaking credentials into errors or logs
  • handles successful 200 responses, 304 Not Modified, conditional requests with ETag, and gzip responses with a 10 MiB decoded-body limit
  • retains the last known good configuration across request, response, parsing, and application failures, and only advances the ETag after a configuration is successfully applied
  • independently suppresses repeated warnings by failure category and resets that suppression after fork in the child
  • expands the configuration-name buffer so the agentless environment variables and their generated datadog.* INI names fit
  • adds unit coverage for process-wide state, state transitions, retry classification and timing, cancellation, request construction, authentication, ETag behavior, gzip limits, and single-request concurrency

Scope of this PR

This PR implements the process state and agentless delivery engine, but does not activate it from tracer startup or connect it to the PHP OpenFeature provider. Startup/source selection, fork-hook integration, shutdown, and the user-facing provider behavior follow in subsequent PRs in the stack. This PR should not be merged independently from the completed stack.

The currently supported OpenFeature PHP SDK does not expose provider initialization, shutdown, status, or event APIs. Consequently, this layer provides the required lifecycle and state primitives internally, while the later SDK integration will use the documented first-evaluation compatibility path for initialization errors and cannot expose standard provider lifecycle notifications until upstream SDK support exists.

Validation

  • rustfmt --edition 2021 --check components-rs/ffe.rs components-rs/ffe/agentless.rs
  • git diff --check
  • cargo check --locked --lib
  • cargo clippy --locked --lib -- -D warnings
  • cargo test --locked --lib
  • make -j8

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

Relates to FFL-2705.

@pavlokhrebto pavlokhrebto changed the title feat(ffe): add process-wide state and agentless poller feat(ffe): add process-wide state and agentless polling Sep 15, 2026
@datadog-datadog-prod-us1

datadog-datadog-prod-us1 Bot commented Sep 15, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

❌ Errors

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 41 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-php | ASAN test_c: [7.4, arm64] — ❄️ 1 known flaky test

View more details · View in GitLab

↳ ❄️ Known flaky: tmp/build_extension/tests/ext/telemetry/config.phpt (Report user config telemetry) from PHP.tmp.build_extension.tests.ext.telemetry

DataDog/apm-reliability/dd-trace-php | ASAN test_c: [8.4, arm64] — ❄️ 1 known flaky test

View more details · View in GitLab

↳ ❄️ Known flaky: tmp/build_extension/tests/ext/telemetry/config.phpt (Report user config telemetry) from php.tmp.build_extension.tests.ext.telemetry

DataDog/apm-reliability/dd-trace-php | ASAN test_c with multiple observers: [8.0] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 41 failed jobs.

ℹ️ Info

No other issues found (see more)

❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 55.03% (-0.71%)

Useful? React with 👍 / 👎

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant