Skip to content

Conversation

@detsch
Copy link
Member

@detsch detsch commented Nov 17, 2025

Updates might get stuck in the "completing" state if we hit an error inside runnerImpl.complete. The user can't currently recover from this.

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>
@detsch detsch requested a review from mike-sul November 17, 2025 19:49
return u.store.lock(func(db *session) error {
if !u.State.IsOneOf(StateCreated, StateInitializing, StateInitialized,
StateFetching, StateFetched, StateInstalling, StateInstalled) {
StateFetching, StateFetched, StateInstalling, StateInstalled, StateCompleting) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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.

@mike-sul
Copy link
Collaborator

Updates might get stuck in the "completing" state if we hit an error
inside runnerImpl.complete. The user can't currently recover from this.

According to this

u.State = StateFailed
the update state is moved to the "failed" if an error occurs during running complete, so it is not quite clear how/why a user can get stuck at the "completing" state.

@detsch
Copy link
Member Author

detsch commented Nov 18, 2025

Updates might get stuck in the "completing" state if we hit an error
inside runnerImpl.complete. The user can't currently recover from this.

According to this

u.State = StateFailed

the update state is moved to the "failed" if an error occurs during running complete, so it is not quite clear how/why a user can get stuck at the "completing" state.

What about the errors.Is(err, compose.ErrUninstallRunningApps) case?

I was hitting the situation of having a update stuck in completing state with some early testing code, I can try to reproduce it again if necessary. But if I'm not mistaken, it was a situation where there were leftover apps that were not stopped and could not be uninstalled.

What if the process gets killed before the we have the chance of setting u.State = StateFailed? Not likely, but we do need some way of recover from such situation. I was experiencing a situation that could not be recovered by just calling fioup commands.

@mike-sul
Copy link
Collaborator

What if the process gets killed before the we have the chance of setting u.State = StateFailed?

The update will be in "completing" state and the next attempt will "complete" it.

@mike-sul
Copy link
Collaborator

mike-sul commented Nov 18, 2025

What about the errors.Is(err, compose.ErrUninstallRunningApps) case?

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 update complete --prune attempts, and then if keeps failing then just run update complete (no pruning) to complete the update.

It looks like we need to adjust fioup implementation to handle ErrUninstallRunningApps.

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?

@detsch
Copy link
Member Author

detsch commented Nov 18, 2025

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.

@mike-sul
Copy link
Collaborator

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 cancel as it marks an update as "canceled" not as "completed" (ok).
I rather suggest to improve the "Complete" API call and allow doing enforced completion of successfully started update.

@detsch detsch closed this Nov 21, 2025
@detsch
Copy link
Member Author

detsch commented Nov 21, 2025

Closed in favor of #105 and foundriesio/fioup#147

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.

3 participants