Skip to content

docs(flagd): Update deadline docs #1011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions providers/flagd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Given below are the supported configurations:
| socketPath | FLAGD_SOCKET_PATH | String | null | rpc & in-process |
| certPath | FLAGD_SERVER_CERT_PATH | String | null | rpc & in-process |
| deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process |
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process |
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | long | 0 | rpc & in-process |
| selector | FLAGD_SOURCE_SELECTOR | String | null | in-process |
| cache | FLAGD_CACHE | String - lru, disabled | lru | rpc |
Expand All @@ -134,14 +135,30 @@ platforms or architectures.
Reconnection is supported by the underlying GRPCBlockingStub. If the connection to flagd is lost, it will reconnect
automatically.

### Deadline (gRPC call timeout)
### Deadlines

Deadlines are used to define how long the provider waits to complete initialization or flag evaluations.
They behave differently based on the resolver type.

#### Deadlines with Remote resolver (RPC)

The deadline for an individual flag evaluation can be configured by calling `setDeadline(myDeadlineMillis)`.
If the gRPC call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
If the remote evaluation call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
and the evaluation will default.
The default deadline is 500ms, though evaluations typically take on the order of 10ms.
For the in-process provider, the deadline is used when establishing the initial streaming connection.
A failure to connect within this timeout will result in an [error event](https://openfeature.dev/docs/reference/concepts/events#provider_error) from the provider, though it will attempt to reconnect indefinitely.

#### Deadlines with In-process resolver

In-process resolver with remote evaluation uses the `deadline` for synchronous gRPC calls to fetch metadata from flagD.
If fetching metadata fails within this deadline, the provider will try to reconnect.
The `streamDeadlineMs` defines a deadline for the streaming connection that listens to flag configuration updates from
flagD. After the deadline exceeds, the provider closes the gRPC stream and will attempt to reconnect.

A failure to connect within the deadline will result in
an [error event](https://openfeature.dev/docs/reference/concepts/events#provider_error) from the provider, though it will attempt to reconnect indefinitely.

In-process resolver with offline evaluation uses the `deadline` for file reads to fetch flag definitions.
If the provider cannot open and read the file within this deadline, the provider will default the evaluation.


### TLS

Expand Down