From 73922b2efb3ad766ae1a46e627f779262aa6bc56 Mon Sep 17 00:00:00 2001 From: Todd Baert Date: Tue, 28 Nov 2023 12:14:19 -0500 Subject: [PATCH] feat: NOT_READY after provider shutdown (#216) Signed-off-by: Todd Baert --- specification.json | 7 +++++++ specification/sections/02-providers.md | 14 +++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/specification.json b/specification.json index 3d55422d..86c76e66 100644 --- a/specification.json +++ b/specification.json @@ -443,6 +443,13 @@ "RFC 2119 keyword": "MAY", "children": [] }, + { + "id": "Requirement 2.5.2", + "machine_id": "requirement_2_5_2", + "content": "After a provider's shutdown function has terminated successfully, the provider's state MUST revert to its uninitialized state.", + "RFC 2119 keyword": "MUST", + "children": [] + }, { "id": "Requirement 2.6.1", "machine_id": "requirement_2_6_1", diff --git a/specification/sections/02-providers.md b/specification/sections/02-providers.md index f0497bff..46a29dd5 100644 --- a/specification/sections/02-providers.md +++ b/specification/sections/02-providers.md @@ -203,12 +203,15 @@ title: Provider State stateDiagram-v2 direction LR [*] --> NOT_READY - NOT_READY --> READY + NOT_READY --> READY:initialize READY --> ERROR ERROR --> READY READY --> STALE STALE --> READY STALE --> ERROR + READY --> NOT_READY:shutdown + STALE --> NOT_READY:shutdown + ERROR --> NOT_READY:shutdown ``` see [provider status](../types.md#provider-status) @@ -250,6 +253,15 @@ class MyProvider implements Provider, AutoDisposable { } ``` +#### Requirement 2.5.2 + +> After a provider's shutdown function has terminated successfully, the provider's state **MUST** revert to its uninitialized state. + +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. +Providers not requiring initialization are assumed to be ready at all times. + +see: [initialization](#24-initialization) + ### 2.6. Provider context reconciliation [![experimental](https://img.shields.io/static/v1?label=Status&message=experimental&color=orange)](https://github.com/open-feature/spec/tree/main/specification#experimental)