Skip to content

Remove race conditions involving finding available ports - #18698

Merged
Hixie merged 1 commit into
flutter:masterfrom
Hixie:neverFindAvailablePort
Jun 27, 2018
Merged

Hixie merged 1 commit into
flutter:masterfrom
Hixie:neverFindAvailablePort

Conversation

@Hixie

@Hixie Hixie commented Jun 21, 2018

Copy link
Copy Markdown
Contributor

This is an attempt to reland #18488 with less breakage on macOS.

@Hixie

Hixie commented Jun 21, 2018

Copy link
Copy Markdown
Contributor Author

cc @goderbauer

@goderbauer

Copy link
Copy Markdown
Member

Looks like Travis, Cirrus, and Appveyor are unhappy with this.

@Hixie

Hixie commented Jun 22, 2018

Copy link
Copy Markdown
Contributor Author

Sigh. I was expecting the devicelab to go red, not EVERYTHING. :-)

@Hixie
Hixie force-pushed the neverFindAvailablePort branch from a56c7f1 to ab08b02 Compare June 22, 2018 20:40
@amirh

amirh commented Jun 25, 2018

Copy link
Copy Markdown
Contributor

Haven't started reviewing yet, but some details about the root cause and the fix in the PR description will help me to review this.

@Hixie

Hixie commented Jun 26, 2018

Copy link
Copy Markdown
Contributor Author

The code used to have places where it looked for an available port, then passed that port to some other code and had that code open the port. That's an inherently racy operation and should never be done. This PR removes all code that did that.

Comment thread dev/devicelab/lib/framework/runner.dart Outdated

@amirh amirh Jun 26, 2018 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does it do when you give it 0?
Can't find the answer in dart --help.

Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment saying the 0 will get the system to choose a free port?

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.

done

@amirh amirh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread dev/devicelab/lib/framework/utils.dart Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This feels pretty fragile, does the Dart team know we depend on this specific line format?
Maybe worth adding a comment where they print this information to emphasize that Flutter depends on it?

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.

We don't really depend on it so much as we'll just need to update the pattern when they change.

In reality, it's quite possible that there's people out there who do depend on it. Any time you change anything, you could break people.

Comment thread dev/devicelab/lib/framework/runner.dart Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe add a comment saying the 0 will get the system to choose a free port?

@Hixie
Hixie force-pushed the neverFindAvailablePort branch from ab08b02 to 01dd6de Compare June 27, 2018 00:34
This is an attempt to reland flutter#18488 with less breakage on macOS.
@Hixie
Hixie force-pushed the neverFindAvailablePort branch from 01dd6de to 9955e25 Compare June 27, 2018 21:35
@Hixie

Hixie commented Jun 27, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for the review. Will land on green.

@Hixie
Hixie merged commit 35ad2a7 into flutter:master Jun 27, 2018
@Hixie
Hixie deleted the neverFindAvailablePort branch June 27, 2018 23:44
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Aug 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants