Azure / Azure/azure-cli

Hanging `python.exe` threads when running any az cli commands

Open
#29,089 10 comments 1 reaction 1 assignee Claimed by @bebound View on GitHub
Auto-Resolve Azure CLI Team customer-reported question
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### Describe the bug

In a Microsoft Terminal Powershell, I run any azure cli command, this completes successfully.
However, the `python.exe` process which ran when the command was issued remains, using up a full single core.
This continues with each additional execution of the az cli, with the number of `python.exe` equal to the number az cli calls made.

For example, calling `az --version` 3 times, results in 3 `python.exe` processes remaining, with full single core cpu demands.
Each call completes successfully

![image](https://github.com/Azure/azure-cli/assets/34489160/a65472db-b041-4c04-9357-8a59132912e3)

Even after closing the terminal session, the processes remain:

![image](https://github.com/Azure/azure-cli/assets/34489160/511fa892-f4fe-4c84-817c-970143c0abaa)

The processes can be killed through Task Manager, but will remain taking up significant system resource if not killed.

### Related command

Tested with any call to the azure cli `az` tools.

### Errors

There are no error messages, just hanging processes.

### Issue script & Debug output

There is no bug or error report.

### Expected behavior

The expected behaviour would be the `python.exe` threads terminating on the successful completion of the `az cli` command.

### Environment Summary

azure-cli 2.60.0 *

core 2.60.0 *
telemetry 1.1.0

Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\ed.morris\.azure\cliextensions'

Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 21:52:07) [MSC v.1937 32 bit (Intel)]

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.