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

Launch fix port #40936

Merged
merged 2 commits into from
Mar 28, 2022
Merged

Launch fix port #40936

merged 2 commits into from
Mar 28, 2022

Conversation

kuizhiqing
Copy link
Member

@kuizhiqing kuizhiqing commented Mar 25, 2022

PR types

Bug fixes

PR changes

Others

Describe

Fix get_free_port may generate the same ports sometimes.

Copy link
Contributor

@xymyeah xymyeah left a comment

Choose a reason for hiding this comment

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

LGTM

struct.pack('ii', 1, 0))
s.bind(('', 0))
return s.getsockname()[1]
for _ in range(100):
Copy link
Contributor

Choose a reason for hiding this comment

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

最好加个注释,解释一下这样做的原因

Copy link
Member Author

Choose a reason for hiding this comment

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

原因为多次调用该函数返回的端口可能存在重复引发冲突。后续补充进注释。

Copy link
Contributor

@GuoxiaWang GuoxiaWang left a comment

Choose a reason for hiding this comment

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

LGTM

@sandyhouse sandyhouse merged commit 8fe8039 into PaddlePaddle:develop Mar 28, 2022
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.

5 participants