Skip to content

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

5 participants