[bug] Handle gracefully malformed flag evaluations; migrate Date->Instant - #11535
Conversation
This comment has been minimized.
This comment has been minimized.
…2339-instant-allocation-windows # Conflicts: # products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/RemoteConfigServiceImpl.java # products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/RemoteConfigServiceImplTest.java
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
🐑 PR Shepherd is maintaining this PRI watch your PR and automatically fix CI failures, rebase your branch, handle flaky tests, and push it to the merge queue when it's ready. More about what I do → Guide To pause me on this PR, add the |
…2339-instant-allocation-windows # Conflicts: # products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/RemoteConfigServiceImplTest.java
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status in_progress |
Exclude serialization failures from telemetry and log submission failures at debug level. Environment: Datadog workspace
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
Build pipeline has failing jobs for ccdb965: What to do next?
|
|
/merge |
|
View all feedbacks in Devflow UI.
PR already in the queue with status in_progress |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
|
Hi! 👋 Thanks for your pull request! 🎉 To help us review it, please make sure to:
If you need help, please check our contributing guidelines. |
Motivation
Allocation windows are UTC instants, but converting parsed timestamps through
Dateloses sub-millisecond precision. Evaluation needs the original precision while the existing UFC v1 publicDatefields remain compatible with agent code compiled against that model.Malformed individual flags are skipped so valid flags can continue evaluating, but operators need a payload-free warning when a flag is rejected. Exposure contexts can also contain OpenFeature
Instantvalues; sending those objects directly to Moshi can make exposure serialization fail repeatedly and block later batches.Changes
The remote-config parser reads allocation
startAtandendAtvalues through anInstantadapter and constructs allocations withAllocation.fromInstants. TheAllocationmodel retains its publicDate startAtandDate endAtfields for compatibility, while private preciseInstantvalues and accessors preserve sub-millisecond timestamps for evaluator comparisons. Existing callers that construct allocations withDatecontinue to work.When a flag cannot be parsed, the parser still skips only that flag and now emits a warning containing the flag key and parser error summary. The log excludes the flag payload and stack trace.
OpenFeature
Instantcontext values are flattened to ISO-8601 strings before exposure serialization. Exposure serialization failures now log and drop only the poisoned batch, while transport failures retain the existing retry behavior.Tests cover UTC offsets and fractional precision, retained
Datecompatibility, microsecond allocation boundaries, the realJsonReader.Token.NULLadapter path,Instantcontext flattening, and recovery after an unserializable exposure batch.Decisions
Preserve the UFC v1 public
Datefields instead of introducing an ABI-breaking field-type change. PreciseInstantstorage remains internal and evaluator code uses the accessors.Keep
ISO_OFFSET_DATE_TIMEparsing so timestamps with offsets such as+01:00and-05:00remain accepted.Keep malformed-flag logging summary-only. Passing the exception as a throwable argument could add stack-trace output, which is intentionally excluded from this warning.
Drop only batches that cannot be serialized. Continue retrying network and EVP delivery failures.
Validation
./gradlew :products:feature-flagging:feature-flagging-bootstrap:spotlessCheck :products:feature-flagging:feature-flagging-lib:test :products:feature-flagging:feature-flagging-lib:spotlessCheck :products:feature-flagging:feature-flagging-api:test :products:feature-flagging:feature-flagging-api:spotlessCheckBUILD SUCCESSFUL./gradlew :products:feature-flagging:feature-flagging-lib:test --tests com.datadog.featureflag.RemoteConfigServiceImplTest :products:feature-flagging:feature-flagging-lib:spotlessCheckBUILD SUCCESSFUL in 18s