SYN-3465: Storm Package Uninstall Hook#4840
Draft
MichaelSquires wants to merge 19 commits intosynapse-3xxfrom
Draft
SYN-3465: Storm Package Uninstall Hook#4840MichaelSquires wants to merge 19 commits intosynapse-3xxfrom
MichaelSquires wants to merge 19 commits intosynapse-3xxfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## synapse-3xx #4840 +/- ##
===============================================
+ Coverage 96.23% 96.25% +0.01%
===============================================
Files 259 259
Lines 63244 63433 +189
===============================================
+ Hits 60866 61059 +193
+ Misses 2378 2374 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This comment was marked as resolved.
This comment was marked as resolved.
MichaelSquires
commented
Mar 27, 2026
MichaelSquires
commented
Mar 27, 2026
MichaelSquires
commented
Mar 28, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
| except asyncio.CancelledError: | ||
| raise | ||
| except Exception as exc: | ||
| logger.warning(f'onuninstall failed for package: {name}', exc_info=exc, extra=logextra) |
Contributor
There was a problem hiding this comment.
Similar to the question about safemode, won't the uninstall still complete even it "failed"?
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
mikemoritz
reviewed
Mar 30, 2026
| if keep is None or 'pkg-vars' not in keep: | ||
| pkgvars = self._getStormPkgVarKV(name) | ||
| for key in list(pkgvars.keys()): | ||
| await self.popStormPkgVar(name, key) |
Contributor
There was a problem hiding this comment.
I can imagine the things we are storing in storm pkgvars could grow over time, so maybe we would want a delStormPkgVarKV so its just one nexus txn?
Contributor
Author
There was a problem hiding this comment.
I can open a ticket for this.
invisig0th
requested changes
Mar 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Core Logic (
synapse/cortex.py— +225 lines)uninstallStormPkg()API — graceful uninstall by name with an optionalkeeplist to preserve specific resources (pkg-vars,vaults,dmons,queues,model)onuninstallhook — runs a Storm query from the package definition before cleanup, passing thekeeplist as a variable_cleanupStormPkg()— automatically deletes dmons, queues, vaults, package variables, and extended model elements (types, forms, props, tag props) unless kept_pkgOnloadTasksdict tracks async onload tasks so they can be cancelled during delete/uninstall_loadStormPkgDmons()— packages can now declaratively define dmons that are auto-created after onloadaddStormPkgif_uninstallingflag is setSchema (
synapse/lib/schemas.py— +104 lines)onuninstall,dmons, andmodelfields to the package definition JSON schemamodelsupports declarativetypes,forms,props, andtagpropsStorm CLI (
synapse/lib/stormlib/pkg.py— +63 lines)pkg.del --uninstallflag triggers the new uninstall flow--uninstall-keepargument to specify resources to preservepkg.listshows uninstall status for in-progress uninstallsSupporting Changes
test_lib_stormlib_pkg.pycovering uninstall, keep options, model cleanup, dmon lifecycle, onuninstall hooks, restart recovery, and error cases.