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

dart analytics hangs when there's no internet in wsl2 #45235

Closed
jeiea opened this issue Mar 7, 2021 · 4 comments
Closed

dart analytics hangs when there's no internet in wsl2 #45235

jeiea opened this issue Mar 7, 2021 · 4 comments
Assignees
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool.

Comments

@jeiea
Copy link

jeiea commented Mar 7, 2021

What I did

  • Install archwsl (did not test other distro).
  • Install flutter 2.0.1 by asdf-vm.
  • Disconnect host internet by ipconfig /release.
  • Execute any of dart, dart pub outdated, dart pub upgrade.

Expected behavior

Normal behavior (help output) or at least error message.

Actual behavior

No output, command does not finish.

Additional context

✗ dart --version
Dart SDK version: 2.12.0 (stable) (Thu Feb 25 19:50:53 2021 +0100) on "linux_x64"
✗ uname -a
Linux DESKTOP-10AAD8A 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 GNU/Linux

After I executed dart --disable-analytics, dart command exited normally.

@srawlins srawlins added the area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool. label Mar 8, 2021
@bkonyi
Copy link
Contributor

bkonyi commented Mar 17, 2021

@sigurdm is it possible to add a timeout or network check when executing analytics code? What about pub?

@sigurdm
Copy link
Contributor

sigurdm commented Mar 18, 2021

Hmm - it should time out: https://github.com/dart-lang/sdk/blob/master/pkg/dartdev/lib/dartdev.dart#L254 .

I wonder what goes wrong.

@jonasfj any ideas?

@jonasfj
Copy link
Member

jonasfj commented Mar 19, 2021

hmm, if we're not cancelling the TCP connections, and we're not doing a force exit(0) from dart:io, then I suppose it could hang.

If this is indeed the case, then maybe HttpClient.close(force: true) will fix the issue.

dart-bot pushed a commit that referenced this issue Mar 23, 2021
New commits:

```
> git log --format="%C(auto) %h %s" 6c64d9e7b6b3758d06d030efcb5afe20bfc04dde..HEAD
 5b7317b Force close the http-client on IOAnalytics.close() (#155)
 21e6d3c publishing a null safe stable release (#153)
```

Bug: #45235
Change-Id: I47d6119cdeb8210db2207a9247a5f38e0c1841dd
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192686
Reviewed-by: Jonas Jensen <jonasfj@google.com>
Reviewed-by: Devon Carew <devoncarew@google.com>
Commit-Queue: Sigurd Meldgaard <sigurdm@google.com>
@sigurdm
Copy link
Contributor

sigurdm commented Mar 23, 2021

This should be fixed in the sdk master as of: https://dart-review.googlesource.com/c/sdk/+/192686

@sigurdm sigurdm closed this as completed Mar 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-cli Use area-dart-cli for issues related to the 'dart' command like tool.
Projects
None yet
Development

No branches or pull requests

5 participants