-
Notifications
You must be signed in to change notification settings - Fork 55
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
Ensure cleanup of Stack in foreground deletion #760
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #760 +/- ##
==========================================
- Coverage 50.71% 50.19% -0.53%
==========================================
Files 30 30
Lines 4180 4210 +30
==========================================
- Hits 2120 2113 -7
- Misses 1876 1910 +34
- Partials 184 187 +3 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense to me. Very appropriate use of finalizers to make sure stuff happens in the correct order. I think I ran into the first scenario (no update) when I had things misconfigured, so this should be a good QOL improvement overall.
29b3900
to
d1085c8
Compare
Problem
There's two edge cases where a Stack could become stuck in a deleting state, and this PR addresses both.
Update
object. The stack controller processes the 'current update' (if any) before doing anything else. The stack keeps the name of the current update in its status block, and performs a lookup of the named Update object to check its progress. If the update doesn't exist, it assumes a cache miss and simply requeues. Let's imagine that the update was actually deleted, e.g. via cascading foreground delete. In that case, the stack freezes up.Workspace
object. The stack controller strictly handles workspace setup before kicking off an update, and doesn't re-create the workspace if it were to disappear while the update is in progress. If the workspace goes missing, e.g. due to foreground delete, then the Update blocks indefinitely and likewise does the Stack.An additional constraint is that completed
Update
objects serve as a useful historical record, and would ideally not be garbage-collected when the associatedWorkspace
is deleted. It is desirable that a user be able to delete an idle workspace, and one would not want to discard the history in that case.Proposed changes
Update
object, to ensure that it doesn't disappear while a Stack is waiting for its completion. Once complete, the finalizer is removed and the completed Update object is then targetable by a cleanup routine.Related issues (optional)
Closes #753