Skip to content
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

Clarify pending status, introduce running #340

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

carolynvs
Copy link
Contributor

The current definition for the pending (previously underway) status is difficult to understand when it is acceptable to use and what it really means about the state of the installation. It's described as both a long term state and temporary. It is also described as "to be avoided".

We would like to redefine the state to make it more clear on what the state means, and to make it acceptable for tools to use. Pending now means that the operation has been requested (most likely queued) but has not begun executing. Tools that are immediately executing commands as
they are issued would most likely choose to not use this state. However solutions that accept bundle operations from many users at once, for example a cnab operator, may choose to use this state.

This also introduces a new state: running. Tools may use this state to indicate that a bundle is currently executing an operation. This can be used by tools to provide operational insight into the activity of the system. For example, when an upgrade takes 30 minutes and people don't
know that it's already running, it could easily be initiated more than once by multiple people on the same installation. Allowing tools to make the current status of the installation visible, helps avoid this situation.

Closes #312

Copy link
Member

@jlegrone jlegrone left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good to me!

Copy link
Member

@vdice vdice left a comment

Choose a reason for hiding this comment

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

It certainly makes sense to me to have both pending and running, for the reasons mentioned.

My only reservation lies in what I perceive as an inherent difference between "conclusive" statuses like failure, unknown and success and "transient" statuses like pending and running. Is more prescription warranted in the spec around the mechanism for tools to report back the "conclusive" status for actions whose statuses were formerly pending or running? Would a tool be expected to generate a new claim and result with this "conclusive" status? Or just modify the result on/associated with an existing claim?

Technically, this question existed previous to this PR (it would've been applicable when just pending or underway was around), so it doesn't need to be addressed here... just posing it for thoughts.

@carolynvs
Copy link
Contributor Author

Would a tool be expected to generate a new claim and result with this "conclusive" status? Or just modify the result on/associated with an existing claim?

The expectation is result is a modifiable sub-document, it contains fields that are outputs from the execution of the bundle (per the other PR), and they can be set without requiring a new claim to be created.

@vdice
Copy link
Member

vdice commented Mar 2, 2020

and they can be set without requiring a new claim to be created.

This makes sense. In a follow-up, we might consider adding specification that status updates from transient to completed statuses either should or must update the result object and either should not or must not update the associated claim or claim revision...

400-claims.md Outdated Show resolved Hide resolved
@carolynvs carolynvs force-pushed the clarify-installation-status branch from be4a0c9 to d16b48f Compare March 2, 2020 17:41
Copy link
Contributor

@silvin-lubecki silvin-lubecki left a comment

Choose a reason for hiding this comment

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

LGTM

@technosophos
Copy link
Member

Follow-up issues should be filed in cnab-go and libcnab-rust

- `pending`: Execution has been requested and has not begun. This should be considered a temporary status, and the runtime SHOULD work to resolve this to either `failure` or `success`.
- `running`: Execution is in progress and has not completed. This should be considered a temporary status, and the runtime SHOULD work to resolve this to either `failure` or `success`.
- `unknown`: The state is unknown. This is an error condition.
- `success`: Completed successfully.
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps we should have cancelled as well?

- `pending`: in progress. This should only be used if the invocation container MUST exit before it can determine whether all operations are complete. Note that `pending` is a _long term status_ that indicates that the installation's final state cannot be determined by the system. For this reason, it should be avoided. When used, `pending` should be considered a temporary status, and the runtime SHOULD work to resolve this to either `failure` or `success`.
- `unknown`: the state is unknown. This is an error condition.
- `success`: completed successfully
- `failure`: Failed before completion.
Copy link
Member

Choose a reason for hiding this comment

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

It might be more consistent to use an adjective for each status

Suggested change
- `failure`: Failed before completion.
- `failed`: Failed before completion.

- `pending`: Execution has been requested and has not begun. This should be considered a temporary status, and the runtime SHOULD work to resolve this to either `failure` or `success`.
- `running`: Execution is in progress and has not completed. This should be considered a temporary status, and the runtime SHOULD work to resolve this to either `failure` or `success`.
- `unknown`: The state is unknown. This is an error condition.
- `success`: Completed successfully.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- `success`: Completed successfully.
- `succeeded`: Completed successfully.

The current definition for the pending (previously underway) status is
difficult to understand when it is acceptable to use and what it really
means about the state of the installation. It's described as both a long
term state and temporary. It is also described as "to be avoided".

We would like to redefine the state to make it more clear on what the
state means, and to make it acceptable for tools to use. Pending now
means that the operation has been requested (most likely queued) but has
not begun executing. Tools that are immediately executing commands as
they are issued would most likely choose to not use this state. However
solutions that accept bundle operations from many users at once, for
example a cnab operator, may choose to use this state.

This also introduces a new state: running. Tools may use this state to
indicate that a bundle is currently executing an operation. This can be
used by tools to provide operational insight into the activity of the
system. For example, when an upgrade takes 30 minutes and people don't
know that it's already running, it could easily be initiated more than
once by multiple people on the same installation. Allowing tools to make
the current status of the installation visible, helps avoid this
situation.

Signed-off-by: Carolyn Van Slyck <[email protected]>
@carolynvs carolynvs force-pushed the clarify-installation-status branch from d16b48f to fbbed9e Compare March 4, 2020 18:01
@radu-matei radu-matei merged commit 8a4242d into cnabio:master Mar 4, 2020
@carolynvs
Copy link
Contributor Author

I will open a follow-on PR to standardize our verbs and add cancelled.

@carolynvs carolynvs deleted the clarify-installation-status branch March 4, 2020 18:04
carolynvs pushed a commit to carolynvs/cnab-go that referenced this pull request Mar 4, 2020
Synchronize the claim status names with recent spec changes from

* cnabio/cnab-spec#344
  * success -> succeeded
  * failure -> failed
* cnabio/cnab-spec#345
  * +cancelled
* cnabio/cnab-spec#340
  * +running

Signed-off-by: Carolyn Van Slyck <[email protected]>
carolynvs pushed a commit to cnabio/cnab-go that referenced this pull request Mar 12, 2020
* Sync claim status names with the spec

Synchronize the claim status names with recent spec changes from

* cnabio/cnab-spec#344
  * success -> succeeded
  * failure -> failed
* cnabio/cnab-spec#345
  * +cancelled
* cnabio/cnab-spec#340
  * +running

Signed-off-by: Carolyn Van Slyck <[email protected]>

* Match claim status const names with value

Update the const names to match the new values, and deprecate
StatusSuccess and StatusFailure.

Signed-off-by: Carolyn Van Slyck <[email protected]>
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.

Claims: Store a claim when an action has started
7 participants