Skip to content

Remove race conditions involving finding available ports - #18488

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

Hixie merged 1 commit into
flutter:masterfrom
Hixie:neverFindAvailablePort

Conversation

@Hixie

@Hixie Hixie commented Jun 14, 2018

Copy link
Copy Markdown
Contributor

No description provided.

@Hixie

Hixie commented Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

(sent breaking change announcement)

@Hixie
Hixie force-pushed the neverFindAvailablePort branch from 47ce3cc to 6b2cd72 Compare June 15, 2018 04:12

@goderbauer goderbauer 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.

LGTM

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.

This will fail in IPv6

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.

(might not be a big deal since we control the devicelab and can just say that it's hard coded to be IPv4....)

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.

I've fixed the places that mention 127.0.0.1 explicitly to extract the port in an ipv6-compatible manner but I haven't gone further down the yak shave of making devicelab ipv6-safe.

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.

ProcessException

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

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.

assert(hostPort >= 0)?

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 guarantee that. We could audit all the call sites to make sure that the callers all check the range on the port, but as of right now we're depending on adb to do that.

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.

Are we sure this will always succeed given correct user input?

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.

If not, then let's throw a ProcessException instead, where we can include the stderr, exitCode, etc.

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.

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.

It's too bad that this is called --debug-port here and --observatory-port in flutter screenshot...

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.

yeah. i'll leave that to another yak shave.

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.

I filed libimobiledevice/libimobiledevice#674 for iproxy to support hostPort==0

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.

oh thanks. i had looked into doing that (or even submitting a patch) but got confused about which project it corresponded to and then forgot.

@Hixie
Hixie force-pushed the neverFindAvailablePort branch from 6b2cd72 to e15c299 Compare June 15, 2018 18:11
@Hixie
Hixie force-pushed the neverFindAvailablePort branch from e15c299 to 63971d0 Compare June 15, 2018 19:52
@Hixie
Hixie merged commit 7750872 into flutter:master Jun 15, 2018
@Hixie
Hixie deleted the neverFindAvailablePort branch June 15, 2018 21:16
srawlins added a commit to srawlins/flutter that referenced this pull request Jun 15, 2018
* master:
  Remove race conditions involving finding available ports (flutter#18488)
  Skip painting hidden children of a sliver list (flutter#18465)
  Fixed some typos (flutter#18516)
  update Tristate checkbox semantics to consider indeterminate as "unchecked" (flutter#18297)
  Add flutter tool support for creating app-specific VM snapshots. (flutter#18417)
  mention Text.rich on RichText (flutter#18434)
  invert children for real (flutter#18489)
  Fix clipping for SliverLists (flutter#18410)
  Keep TextFields visible when keyboard comes up (flutter#18291)
  Update all packages (flutter#18506)
  Prepare for upgrading video player in Gallery to newest version (flutter#18501)
  Update Android dependencies (flutter#18499)
  Enable running with prebuilt test-only apk (flutter#18453)
  Revert "Update all packages (flutter#18471)" (flutter#18492)
  Add some more dart doc to RepaintBoundary (flutter#17183)
  Update all packages (flutter#18471)
  Clean up output of "flutter run --release" (flutter#18380)
  Ensure errors launching emulators are exposed to the daemon (flutter#18446)
  Check video widget is mounted on call to setState (flutter#18467)
  Fixed concurrent list modification in vmservice.dart
Hixie added a commit that referenced this pull request Jun 15, 2018
Hixie added a commit that referenced this pull request Jun 15, 2018
srawlins added a commit to srawlins/flutter that referenced this pull request Jun 16, 2018
* master:
  Add minimum height and width box constraints to input decoration icons (flutter#18480)
  Fix aot_snapshot_size_* benchmarks (flutter#18520)
  Revert "Remove race conditions involving finding available ports (flutter#18488)" (flutter#18521)
jonahwilliams pushed a commit that referenced this pull request Jun 16, 2018
jonahwilliams pushed a commit that referenced this pull request Jun 16, 2018
Hixie added a commit to Hixie/flutter that referenced this pull request Jun 20, 2018
Hixie added a commit to Hixie/flutter that referenced this pull request Jun 27, 2018
This is an attempt to reland flutter#18488 with less breakage on macOS.
Hixie added a commit that referenced this pull request Jun 27, 2018
This is an attempt to reland #18488 with less breakage on macOS.
@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