Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential conflict in generating_ssh_keys provided by azure-cli-core #18854

Closed
FumingZhang opened this issue Jul 14, 2021 · 1 comment
Closed
Assignees
Labels
Core CLI core infrastructure feature-request
Milestone

Comments

@FumingZhang
Copy link
Member

FumingZhang commented Jul 14, 2021

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Describe the bug

When performing concurrent tests recently, we found that the generate_ssh_keys function provided by the cli core has potential concurrency conflicts.

In the existing implementation, when multiple processes try to create an ssh key, process A may have created a file but has not yet written key data, while process B reads an empty file at this time and obtains illegal empty key data.

In our module(acs/aks-preview), the example of calling this function is located in the validator.

For end users, this problem may also occur when users create multiple clusters (az aks create) at the same time and there is no ssh key that has been generated.

To Reproduce

Expected behavior

Environment summary

Additional context

A simple solution is to add a global lock to the generate_ssh_keys function.

@ghost ghost added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jul 14, 2021
@yonzhan yonzhan added the Core CLI core infrastructure label Jul 14, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Jul 14, 2021
@yonzhan yonzhan added this to the Jul 2021 (2021-08-03) milestone Jul 14, 2021
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 14, 2021

@jiasli for awareness

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core CLI core infrastructure feature-request
Projects
None yet
Development

No branches or pull requests

3 participants