Skip to content

Conversation

@alexandraoberaigner
Copy link
Contributor

This PR

This pull request introduces configurable retry and fatal error handling for the in-process gRPC sync provider in the flagd project. The main changes include adding new configuration options for retry backoff timing and fatal status codes, refactoring environment variable parsing, and updating service initialization and error handling logic.

Related Issues

Changes

Retry and fatal error configuration (most important):

  • Added new configuration options (RetryBackoffMs, RetryBackoffMaxMs, FatalStatusCodes) to ProviderConfiguration, with environment variable support and helper functions for parsing integer values from environment variables. [1] [2] [3] [4] [5] [6]
  • Updated provider and service initialization to pass the new retry and fatal error configuration fields, enabling customization of retry timing and fatal error handling for sync streams. [1] [2] [3]

Refactoring and code quality:

  • Refactored environment variable parsing for integer values using a new helper function, simplifying and unifying logic for multiple configuration fields. [1] [2] [3]
  • Moved gRPC retry policy construction and fatal status code normalization to a new file grpc_config.go, making the code more modular and testable. [1] [2] [3] [4] [5]

Error handling improvements:

  • Enhanced sync error handling to detect fatal gRPC status codes and transition the provider to a fatal state, preventing endless retries on unrecoverable errors.
  • Updated test coverage for retry policy construction, fatal status code normalization, and camel-case conversion logic in grpc_config_test.go.

…out, disable @forbidden test for rpc

Signed-off-by: Alexandra Oberaigner <[email protected]>
@alexandraoberaigner alexandraoberaigner marked this pull request as ready for review November 14, 2025 07:45
@alexandraoberaigner alexandraoberaigner requested review from a team as code owners November 14, 2025 07:45
@aepfli
Copy link
Member

aepfli commented Nov 14, 2025

As we are adding new config options, we should wait for open-feature/flagd-testbed#311 to be merged to ensure property names are in consistent for all the providers based on the docs.

}
return reflect.ValueOf(longVal).Convert(fieldType)
case "StringList":
arrayVal := strings.Split(value, ",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we also need to trim here?

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.

Infinite retry to establish connection to FlagSyncService in Flagd golang provider

5 participants