Skip to content

Commit 73922b2

Browse files
authored
feat: NOT_READY after provider shutdown (#216)
Signed-off-by: Todd Baert <[email protected]>
1 parent 2973c53 commit 73922b2

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

specification.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,13 @@
443443
"RFC 2119 keyword": "MAY",
444444
"children": []
445445
},
446+
{
447+
"id": "Requirement 2.5.2",
448+
"machine_id": "requirement_2_5_2",
449+
"content": "After a provider's shutdown function has terminated successfully, the provider's state MUST revert to its uninitialized state.",
450+
"RFC 2119 keyword": "MUST",
451+
"children": []
452+
},
446453
{
447454
"id": "Requirement 2.6.1",
448455
"machine_id": "requirement_2_6_1",

specification/sections/02-providers.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,15 @@ title: Provider State
203203
stateDiagram-v2
204204
direction LR
205205
[*] --> NOT_READY
206-
NOT_READY --> READY
206+
NOT_READY --> READY:initialize
207207
READY --> ERROR
208208
ERROR --> READY
209209
READY --> STALE
210210
STALE --> READY
211211
STALE --> ERROR
212+
READY --> NOT_READY:shutdown
213+
STALE --> NOT_READY:shutdown
214+
ERROR --> NOT_READY:shutdown
212215
```
213216

214217
see [provider status](../types.md#provider-status)
@@ -250,6 +253,15 @@ class MyProvider implements Provider, AutoDisposable {
250253
}
251254
```
252255

256+
#### Requirement 2.5.2
257+
258+
> After a provider's shutdown function has terminated successfully, the provider's state **MUST** revert to its uninitialized state.
259+
260+
If a provider requires initialization, once it's shut down, it must transition to its initial `NOT_READY` state. Some providers may allow reinitialization from this state.
261+
Providers not requiring initialization are assumed to be ready at all times.
262+
263+
see: [initialization](#24-initialization)
264+
253265
### 2.6. Provider context reconciliation
254266
255267
[![experimental](https://img.shields.io/static/v1?label=Status&message=experimental&color=orange)](https://github.com/open-feature/spec/tree/main/specification#experimental)

0 commit comments

Comments
 (0)