Skip to content

Disable allow_reuse_address (SO_REUSEADDR) on Windows#10955

Merged
jiasli merged 3 commits into
Azure:devfrom
jiasli:fix-10578
Nov 5, 2019
Merged

Disable allow_reuse_address (SO_REUSEADDR) on Windows#10955
jiasli merged 3 commits into
Azure:devfrom
jiasli:fix-10578

Conversation

@jiasli

@jiasli jiasli commented Oct 23, 2019

Copy link
Copy Markdown
Contributor

Fix #10578: az login hangs when more than one instances of az login are launched at the same time on Windows or WSL

The root cause is that HTTPServer can't detect port is in-use on Windows.

To repro, launch az login but do not continue in the browser. Then run az login from another terminal and continue with the login. One of the az instance will get stuck.

This PR disables HTTPServer.allow_reuse_address so that the correct routine is resumed.


This checklist is used to make sure that common guidelines for a pull request are followed.

  • The PR has modified HISTORY.rst describing any customer-facing, functional changes. Note that this does not include changes only to help content. (see Modifying change log).

  • I adhere to the Command Guidelines.

@jiasli jiasli requested review from mmyyrroonn, qwordy, tjprescott and yugangw-msft and removed request for tjprescott October 23, 2019 06:51
@yugangw-msft

Copy link
Copy Markdown
Contributor

Try to test CI, will close and re-open

@qwordy qwordy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for testing.

@qwordy qwordy self-requested a review October 24, 2019 02:31
@qwordy

qwordy commented Oct 24, 2019

Copy link
Copy Markdown
Member

I can't cancel my approval now, which can be done before the permission change. Please don't merge before a real approval.

@qwordy

qwordy commented Oct 24, 2019

Copy link
Copy Markdown
Member

I think we don't need to support multiple az login at same time since we don't support multiple accounts. We can let all other az login fail if there is an az login running. az login should not interleave.
And if we support multiple az login, add write locks to token files. I've seen broken accessTokens.json because of concurrent write. The content is interleaving.

@qwordy qwordy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test how to revoke approval.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).



def _is_wsl(platform_name, release):
def is_wsl():

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering why the original _is_wsl() is ignoring the passed in perameter platform_name, release and calls _get_platform_info() to overwrite them?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to be some forgotten logic.

@jiasli

jiasli commented Oct 14, 2021

Copy link
Copy Markdown
Contributor Author

@welersonlisboa

Copy link
Copy Markdown

#26180

@jiasli

jiasli commented Apr 20, 2023

Copy link
Copy Markdown
Contributor Author

@welersonlisboa, this PR is not relevant to #26180.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

az login hangs after selecting account

5 participants