Skip to content

Commit 40ed928

Browse files
guidobreitoddbaert
andauthored
docs(flagd): Update deadline docs (#1011)
Signed-off-by: Guido Breitenhuber <[email protected]> Signed-off-by: Guido Breitenhuber <[email protected]> Co-authored-by: Todd Baert <[email protected]>
1 parent 60b1446 commit 40ed928

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

Diff for: providers/flagd/README.md

+22-6
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ Given below are the supported configurations:
112112
| socketPath | FLAGD_SOCKET_PATH | String | null | rpc & in-process |
113113
| certPath | FLAGD_SERVER_CERT_PATH | String | null | rpc & in-process |
114114
| deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process |
115+
| streamDeadlineMs | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process |
115116
| keepAliveTime | FLAGD_KEEP_ALIVE_TIME_MS | long | 0 | rpc & in-process |
116117
| selector | FLAGD_SOURCE_SELECTOR | String | null | in-process |
117118
| cache | FLAGD_CACHE | String - lru, disabled | lru | rpc |
@@ -131,17 +132,32 @@ platforms or architectures.
131132

132133
### Reconnection
133134

134-
Reconnection is supported by the underlying GRPCBlockingStub. If the connection to flagd is lost, it will reconnect
135+
Reconnection is supported by the underlying gRPC connections. If the connection to flagd is lost, it will reconnect
135136
automatically.
137+
A failure to connect will result in an [error event](https://openfeature.dev/docs/reference/concepts/events#provider_error) from the provider, though it will attempt to reconnect
138+
indefinitely.
136139

137-
### Deadline (gRPC call timeout)
140+
### Deadlines
141+
142+
Deadlines are used to define how long the provider waits to complete initialization or flag evaluations.
143+
They behave differently based on the resolver type.
144+
145+
#### Deadlines with Remote resolver (RPC)
138146

139147
The deadline for an individual flag evaluation can be configured by calling `setDeadline(myDeadlineMillis)`.
140-
If the gRPC call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
148+
If the remote evaluation call is not completed within this deadline, the gRPC call is terminated with the error `DEADLINE_EXCEEDED`
141149
and the evaluation will default.
142-
The default deadline is 500ms, though evaluations typically take on the order of 10ms.
143-
For the in-process provider, the deadline is used when establishing the initial streaming connection.
144-
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.
150+
151+
#### Deadlines with In-process resolver
152+
153+
In-process resolver with remote evaluation uses the `deadline` for synchronous gRPC calls to fetch metadata from flagd as part of its initialization process.
154+
If fetching metadata fails within this deadline, the provider will try to reconnect.
155+
The `streamDeadlineMs` defines a deadline for the streaming connection that listens to flag configuration updates from
156+
flagd. After the deadline is exceeded, the provider closes the gRPC stream and will attempt to reconnect.
157+
158+
In-process resolver with offline evaluation uses the `deadline` for file reads to fetch flag definitions.
159+
If the provider cannot open and read the file within this deadline, the provider will default the evaluation.
160+
145161

146162
### TLS
147163

0 commit comments

Comments
 (0)