update: Allow cancellation of an update in completing state#104
Conversation
Updates might get stuck in the "completing" state if we hit an error inside runnerImpl.complete. The user can't currently recover from this. Signed-off-by: Andre Detsch <andre.detsch@foundries.io>
| return u.store.lock(func(db *session) error { | ||
| if !u.State.IsOneOf(StateCreated, StateInitializing, StateInitialized, | ||
| StateFetching, StateFetched, StateInstalling, StateInstalled) { | ||
| StateFetching, StateFetched, StateInstalling, StateInstalled, StateCompleting) { |
There was a problem hiding this comment.
This will allow users to "cancel" an update that has been successfully started, as a result successful update is considered as "failing".
Maybe we rather should fix the "composectl update complete" implementation, so it guarantees moving the update state to the "completed" as long as the update is successfully started.
According to this composeapp/pkg/update/update.go Line 423 in 007dc4b complete, so it is not quite clear how/why a user can get stuck at the "completing" state.
|
What about the I was hitting the situation of having a update stuck in What if the process gets killed before the we have the chance of setting |
The update will be in "completing" state and the next attempt will "complete" it. |
That's the case when complete is invoked with pruning and the latter fails because of some uninstall or remove failures. I think a client should do a few It looks like we need to adjust The key question is: Should we consider an update successful if all update apps were pulled, installed, and started successfully while the pruning failed or not? |
I think that is fine. It is OK to consider it successful. |
If so, then we cannot use |
|
Closed in favor of #105 and foundriesio/fioup#147 |
Updates might get stuck in the "completing" state if we hit an error inside runnerImpl.complete. The user can't currently recover from this.