Repository navigation
Conversation
The CDN source sends If-None-Match only when the last applied response had an ETag. Against an endpoint without ETags (a custom one, for example), every poll (30 s by default) decoded and parsed the whole configuration and replaced the current one with an identical copy: a new graph promoted and the old one dying in the old generation, every poll. The source now keeps the SHA-256 of the last body its listener accepted, never the body. A poll whose decoded body has the same hash is handled like a 304: no parse and no dispatch. It still records the response's ETag and still reports a new reason for ignoring the flag selection, since the server can change that without changing the configuration. The hash is recorded only after the listener accepts the configuration, so a failed parse or dispatch is retried. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
🟢 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. |
Java SE requires SHA-256, so its absence is an IllegalStateException rather than a silently disabled skip. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Does This Do
The CDN configuration source no longer re-parses an unchanged configuration when the endpoint sends no
ETag. It keeps the SHA-256 of the last body its listener accepted, never the body itself. A poll whose decoded body has the same hash is handled like a 304: no parse and no dispatch. The poll still records the response'sETag, and still reports a new reason for ignoring the flag selection, since the server can change that without changing the configuration.The hash is recorded only after the listener accepts the configuration, so a failed parse or dispatch is retried on the next poll. A malformed body never matches it, and a good body that returns after a malformed one is recognized as already current.
Motivation
CdnConfigurationSourcesendsIf-None-Matchonly when the last applied response had anETag. The managed endpoints send one, but a custom endpoint (feature.flags.configuration.source.agentless.base.url) may not. Without one, every poll (30 s by default) decoded and parsed the whole configuration and replaced the current one with an identical copy. That's a new graph promoted and the old one dying in the old generation every poll, plus the parse itself: 90.6 MB allocated for the 10,030-flag scale configuration.The hash costs about 5 ms for the 8.2 MB scale body (JDK 21, best of 20) and is computed only when a body is downloaded, never on a 304.
Additional Notes
No change for endpoints that send
ETags.One test expectation changed: in
CdnConfigurationSourceFlagSelectionTest.reportsEachIgnoredReasonOncePerClassLoader, the third poll returns the body its source already applied. It's now dispatched 2 times instead of 3, and its new ignored reason is still reported; the messages and metrics assertions are unchanged.New tests (
CdnConfigurationSourceTest):ETag, plain and gzipped, is dispatched onceETagis recorded and sent on the next pollThree of them fail without the change.
All
dd-openfeaturetests pass; Spotless and SpotBugs pass.Contributor Checklist
type:and (comp:orinst:) labels in addition to any other useful labelsclose,fix, or any linking keywords when referencing an issueUse
solvesinstead, and assign the PR milestone to the issueJira ticket: [PROJ-IDENT]
Review follow-ups
IllegalStateExceptioninstead of silently disabling the skip.🤖 Generated with Claude Code