fix: clean up ServerlessRuntime record and cache on plugin uninstall#749
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request exports the ClearServerlessRuntimeCache method and updates the plugin uninstallation flow to clear the serverless runtime cache and delete the corresponding ServerlessRuntime database records. The reviewer identifies potential cache and database record leaks in the UpgradePlugin flow, which mirrors the uninstall flow, and suggests logging an error if the plugin manager is uninitialized when attempting to clear the cache.
…en refs reach zero
fatelei
approved these changes
Jun 1, 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.
Summary
ServerlessRuntimeDB record when the last tenant uninstalls a serverless plugin (Refs==0), inside the existing transaction — guarded byInstallType == SERVERLESSClearServerlessRuntimeCacheas a public method onPluginManager(renamed from private)RuntimeType == SERVERLESSFixes ENG-474: after uninstall + reinstall, the stale
ServerlessRuntimerecord and cached hostname caused credential requests to route to the deleted serverless endpoint (no such host). Required a Pod restart to recover.Test Plan
serverless_runtimesrow deleted andredis-cli GET "serverless:runtime:<id>"returns(nil)no such hosterror, no Pod restart neededRefers→ 1) → confirm record and cache NOT cleared (Tenant B still active)