Skip to content

fix: avoid immediate keepalive pings to prevent flagd GOAWAY - #463

Open
buildingisfun23 wants to merge 1 commit into
open-feature:mainfrom
buildingisfun23:fix/365-flagdprovider-default-keep-alive-time-0
Open

buildingisfun23 wants to merge 1 commit into
open-feature:mainfrom
buildingisfun23:fix/365-flagdprovider-default-keep-alive-time-0

Conversation

@buildingisfun23

Copy link
Copy Markdown

Fixes #365

FlagdProvider default keep_alive_time = 0 made the gRPC C-core ping immediately and triggered flagd's grpc-go GOAWAY. I set DEFAULT_KEEP_ALIVE to 600000 ms and only add grpc.keepalive_time_ms when keep_alive_time > 0. This prevents immediate pings and lets the channel use gRPC defaults for zero, avoiding the GOAWAY. Tested with unit tests and an end-to-end repro against flagd.

Tested with uv run --no-sync pytest -q: no new test failures (11 tests already failed before the change).

FlagdProvider default keep_alive_time = 0 made the gRPC C-core ping immediately and triggered flagd's grpc-go GOAWAY. I set DEFAULT_KEEP_ALIVE to 600000 ms and only add grpc.keepalive_time_ms when keep_alive_time > 0. This prevents immediate pings and lets the channel use gRPC defaults for zero, avoiding the GOAWAY. Tested with unit tests and an end-to-end repro against flagd.

Assisted-by: glm-5.3-flash
Signed-off-by: Vikas Rao <mvrao@uci.edu>
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ece24c9d-819e-4666-9293-9c047d31e1db
📥 Commits

Reviewing files that changed from the base of the PR and between 83a524b and d59eb8b.

📒 Files selected for processing: 6
  • providers/openfeature-provider-flagd/README.md
  • providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py
  • providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py
  • providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py
  • providers/openfeature-provider-flagd/tests/test_config.py
  • providers/openfeature-provider-flagd/tests/test_grpc_channel_options.py

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The provider’s default keepalive interval changes to 600000 ms. Both gRPC channel builders now set the keepalive option only for positive configured values. Tests cover the default, zero, and custom intervals.

Changes: flagd keepalive behavior

Layer / File(s) Summary
Set and document the default interval
providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py, providers/openfeature-provider-flagd/README.md, providers/openfeature-provider-flagd/tests/test_config.py
The default changes to 600000 ms. The README and configuration test reflect the new value.
Conditionally set the gRPC keepalive option
providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/grpc.py, providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/resolvers/process/connector/grpc_watcher.py, providers/openfeature-provider-flagd/tests/test_grpc_channel_options.py
Both channel builders add grpc.keepalive_time_ms only when the configured value is positive. Tests cover the default, zero, and a custom value.

Priority: ⬆️ High

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to d59eb

The change replaces immediate default pings with a ten-minute interval and leaves non-positive settings to gRPC defaults. No actionable merge-blocking risk is indicated by the supplied implementation and test evidence.

Security architecture risk: ⚪ Minimal · up to d59eb

The change is limited to keepalive timing and option selection. Endpoint selection, TLS and credential handling, retry policies, and request deadlines remain unchanged. No material security risk introduced or worsened by this PR was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed behavior is confined to application-owned channels connecting to the configured flagd endpoint. The inspected change does not add a remotely callable entrypoint, select additional destinations, or grant additional authority.

Trust Boundaries and Controls

  • observed — Keepalive configuration comes from constructor configuration or the process environment. Its new conditional affects only a timing option, not the target or secure-channel branch. The resolver retains its TLS and certificate handling; the watcher additionally retains its existing explicit-credential and authority options. Insecure-channel support is pre-existing, not introduced by this PR.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the main change: preventing immediate keepalive pings that trigger flagd GOAWAY responses.
Description check Passed The description directly explains the keepalive change, the flagd GOAWAY issue, the implementation, linked issue, and test results.
Linked Issues check Passed Issue [#365] requires avoiding the default keep_alive_time=0 behavior that causes immediate gRPC pings and flagd GOAWAY. DEFAULT_KEEP_ALIVE is now 600000 ms. Both GrpcResolver and `GrpcWatch…
Out of Scope Changes check Passed The changes are limited to the keepalive default, channel option handling, related documentation, and automated tests. Each change supports issue [#365]. No unrelated change is demonstrated.
Full details: Linked Issues check

Explanation

Issue [#365] requires avoiding the default keep_alive_time=0 behavior that causes immediate gRPC pings and flagd GOAWAY. DEFAULT_KEEP_ALIVE is now 600000 ms. Both GrpcResolver and GrpcWatcher add grpc.keepalive_time_ms only when keep_alive_time &gt; 0. Tests cover the default, zero, and custom values for both channel paths.

Full details: Docstring Coverage

Explanation

Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 11 functions across 5 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@buildingisfun23

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@buildingisfun23
buildingisfun23 marked this pull request as ready for review October 21, 2026 05:02
@buildingisfun23
buildingisfun23 requested review from a team as code owners October 21, 2026 05:03

This branch has not been deployed

No deployments
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.

FlagdProvider default keep_alive_time=0 causes GOAWAY crash with flagd server

4 participants