feat: keep a PrefectServer until the resources that use it are deleted #409
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 217 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.322
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #409"
general
weight: 0.35
chrisguidry
Deleting a
PrefectServertogether with its work pools, work queues, deployments, or automations deleted the server's Deployment and Service right away. The other resources then couldn't reach the API to delete their Prefect objects, and stayed inTerminatingfor an hour.PrefectServernow has theprefect.io/server-cleanupfinalizer. While any resource in a watched namespace names the server inspec.server, withoutremoteApiUrl, the server keeps the finalizer:DeletionBlockedcondition and aDependentsExistevent name up to five of those resources.The server waits for every resource that uses it, not only ones being deleted. Waiting only for resources with a deletion timestamp would race with
kubectl delete -f server.yaml -f work-pool.yaml, which can reach the operator before the work pool is marked for deletion.Rollout caveats
watch: PrefectServers in Terminating with DeletionBlocked True. They wait for the resources that name them, with no time limit, which is the intended behavior.rollback: earlier releases don't remove prefect.io/server-cleanup. After a downgrade, a deleted server stays in Terminating. #416 documents the fix.no-op: a server already being deleted at upgrade doesn't get the finalizer, because the API server rejects new finalizers on it.<details>
<summary>Session context</summary>
This came out of a review of the release-prep changes. The PRs above it in the stack handle the cases this one doesn't: namespace deletion, foreground deletion, and downgrades.
</details>
🤖 Generated with Claude Code