Repository navigation
Fix the Destroy workflow: avoid the Azure CLI crash - #178
Merged
Merged
Conversation
The Destroy workflow failed in the step added by #173. On GitHub's runners, `az monitor log-analytics workspace delete` crashed inside the Azure CLI before sending anything: deadlock detected by _ModuleLock('requests.structures') That is Azure/azure-cli#33996, open and unfixed: with the CLI's bundled Python 3.14, long-running commands create their credential on a worker thread, and its import of `requests` intermittently collides with the main thread's. The step now sends the same permanent delete as a REST call through `az rest`, which has no worker thread, and waits for the workspace to be gone before the group is deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
The Destroy workflow failed on its first real run (run), in the step I added in #173 and had not been able to test. Nothing was deleted: the next step, which deletes the resource group, was skipped.
Cause
az monitor log-analytics workspace delete --forcecrashed inside the Azure CLI before it sent anything:This is Azure/azure-cli#33996, open, with a fix proposed but not merged. On GitHub's Ubuntu runners the CLI bundles Python 3.14. Its long-running commands create their credential on a worker thread, and that thread's import of
requestsintermittently collides with the main thread's. Others report it foraz network vnet create,az network nsg rule createandaz lab create; rerunning sometimes passes.Change
DELETE …?force=true), throughaz rest.az restdoes its work on one thread, so the collision cannot happen there.infra/README.md: the manual teardown uses the same call. The Azure CLI on a Mac from Homebrew also runs on Python 3.14.Checked
Ran the step's script, as written in the workflow, against a scratch workspace in a scratch resource group: the workspace was gone 13 seconds later and was not in the recycle bin, so the delete is permanent.
Not checked
az resthas no second thread.az group delete --no-waitand the Deploy workflow'saz aks startgo through a different part of the CLI, which makes its first request on the main thread. Neither has failed so far.🤖 Generated with Claude Code