Repository navigation
Conversation
Add --stream-deadline-graceful-close (FLAGD_STREAM_DEADLINE_GRACEFUL_CLOSE). When enabled, sync and event streams reaching the server-side deadline (--stream-deadline) end with an OK status instead of DEADLINE_EXCEEDED. Providers already treat a completed stream as a routine reconnect, so the periodic stream recycle no longer surfaces as an error in provider logs or gRPC client spans. Defaults to false, preserving current behavior. Refs: open-feature#1959 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Alexandre Chakroun <achakroun@macmail.fr>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
✅ Deploy Preview for polite-licorice-3db33c canceled.
|
Extract the server-side deadline result of the v1 and v2 event streams into deadlineExceededResult, removing the duplicated block, and cover both the graceful and non-graceful paths with a unit test. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Alexandre Chakroun <achakroun@macmail.fr>
|
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.



This PR
Adds an opt-in
--stream-deadline-graceful-closeflag (FLAGD_STREAM_DEADLINE_GRACEFUL_CLOSE). When enabled, sync (flagd.sync.v1) and event (flagd.evaluation.v1/v2EventStream) streams that reach the server-side--stream-deadlineend with an OK status instead ofDEADLINE_EXCEEDED.Defaults to
false, so current behavior is unchanged.Related Issues
Implements "Option A.2" from #1959: the server ends the stream with
OKshortly before the client deadline, so there is no error code unless a stream actually hangs past its normal end.Why
Every provider recycles its stream every 10 minutes. Because the stream ends with
DEADLINE_EXCEEDED, this planned recycle shows up as:DEADLINE_EXCEEDEDshouldn't be an error #1959 andEventStream flagd.evaluation.v2.Servicenot clearing trace context js-sdk-contrib#1522;Today each provider has to special-case this. The Python provider demoted the log in open-feature/python-sdk-contrib#405 ("log expected sync-stream recycles at debug, not warning"). A matching change for the Java provider is in progress (open-feature/java-sdk-contrib#1955). Ending the stream with
OKon the server fixes this for all providers and for tracing, with no SDK change: every provider already treats a completed stream as a routine reconnect.Suggested usage
Set the server deadline slightly below the providers'
FLAGD_STREAM_DEADLINE_MS(10 min by default). The server then closes healthy streams cleanly, and the client deadline still catches streams that are actually hung.Notes
exitReasonstaysdeadline_exceededin both modes, so dashboards keep the same breakdown.StreamDeadlineGracefulis added next toStreamDeadlineincore/pkg/service.Configuration, mirroring how the deadline itself is plumbed.How to test
TestSyncServiceDeadlineEndToEndgains a "with graceful deadline" case asserting the stream ends withio.EOF(status OK) rather thanDEADLINE_EXCEEDED.🤖 Generated with Claude Code