Repository navigation
fix(infra): retry the VPC delete until DigitalOcean releases a cluster's subnets - #30
Merged
Merged
Conversation
…r's subnets DigitalOcean refuses to delete a VPC with "Can not delete VPC with active Subnets" for minutes after a DOKS cluster's delete returns, even when the VPC lists no members. Teardown gave up after 3 tries over 6 seconds, so runs with a cluster ended with exit 3. createDeleteVpc waits for the VPC to have no members and retries a refused delete with backoff (5, 10, 20, 30, then every 60 seconds) until the existing VPC timeout: 5 minutes, or 10 after a cluster. Teardown and sweep both use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WSt25UoKGj2mgDNQ4dHVrB
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.
Problem
Runs with a DOKS cluster ended with exit 3 at teardown:
DigitalOcean releases the cluster's subnets some minutes after the cluster delete returns. The VPC's members list is already empty by then, so the existing members wait passed and the delete got only 3 tries over 6 seconds.
Change
createDeleteVpc(src/infra/createDeleteVpc.ts): pollsGET /v2/vpcs/{id}/membersuntil empty, then deletes; a refused delete is retried with backoff (5, 10, 20, 30, then every 60 s) until the VPC timeout (5 min, or 10 min after a cluster). The last try lands on the deadline. Failure reason:after 10 minutes and N attempts: <message>.createTeardownuses it in place of the members wait plus 3-try delete. Sweep goes through teardown, so it behaves the same.Exit code 3 at collect
createCollectreturns 0 or 1 from the verdicts (EXIT_NOT_PASSED= 1) and turns the code into 3 only when teardown reports a failure (or the run failed / produced nothing). So the exit 3 here came from the VPC failure alone; verdict exit codes are unchanged.Verify
npm test(816 passing),npm run typecheck,npm run lint(ESLint + Prettier).🤖 Generated with Claude Code
https://claude.ai/code/session_01WSt25UoKGj2mgDNQ4dHVrB