Comments (8)
I might check with the flutter
CLI folks to see how they handle it.
from sdk.
Summary: Dart CLI commands, like dart run
and dart test
, hang when internet connectivity is slow or unstable due to analytics collection blocking the execution flow. This issue can be resolved by disabling analytics, but the process itself is also affected by the network latency.
from sdk.
In our previous implementation of analytics it was possible to get a future for the last item sent, wait on that for a brief time w/ a 100ms-200ms timeout, and exit the process if there was a delay in sending (to not hang the VM exit waiting for analytics). We've since re-written the analytics implementation; I'm not sure who's responsible for the integration into the dart cli, but @bkonyi would be the best person to start with.
from sdk.
In our previous implementation of analytics it was possible to get a future for the last item sent, wait on that for a brief time w/ a 100ms-200ms timeout, and exit the process if there was a delay in sending (to not hang the VM exit waiting for analytics). We've since re-written the analytics implementation; I'm not sure who's responsible for the integration into the dart cli, but @bkonyi would be the best person to start with.
Yeah, I'm responsible for the CLI. I thought Elias had done some work to account for this (I know the legacy analytics timeout behavior was brought up), but maybe this never ended up happening.
from sdk.
So this call: https://github.com/dart-lang/sdk/blob/main/pkg/dartdev/lib/dartdev.dart#L262
Should default to timing out after 250ms: https://github.com/dart-lang/tools/blob/main/pkgs/unified_analytics/lib/src/analytics.dart#L548
I wonder if there is some other code path by which we don't run this finally
? Or some other async call to unified_analytics is hanging, before we get to the finally?
from sdk.
Hmm, when we timeout, we call _gaClient.close();
, but I'm thinking maybe that doesn't cancel our pending requests?
https://github.com/dart-lang/tools/blob/main/pkgs/unified_analytics/lib/src/analytics.dart#L554
from sdk.
If I trace the code, it eventually gets to <IOClient>.close()
, which does a .close(force: true
), which should cancel pending requests.
from sdk.
If I trace the code, it eventually gets to
<IOClient>.close()
, which does a.close(force: true
), which should cancel pending requests.
Ok, that makes sense. Also, assuming the flutter cli tool is not susceptible to this bug, then presumably Analytics.close()
is closing these connections.
from sdk.
Related Issues (20)
- Analyzer doesn't notice incorrect return type of generic method HOT 5
- [cfe/ffi] Cascading error on wrong types when using `.address` HOT 1
- Call dart function from a dynamic lib HOT 3
- [CP] Fix analysis_options.yaml "include:" for nested folders in workspace. HOT 1
- False positive in unintended_html_in_doc_comment lint HOT 2
- [breaking change] Compute closures of type schemas in the upper bound computations in the CFE as specified HOT 2
- Assists for adding and maybe removing digit separators from number literals
- [breaking change] Mark `IOOverrides` as `base` HOT 3
- Check if current is available within Iterator without moving the iterator HOT 1
- A directory which is "excluded" via analysis options should not be searched for other analysis options. HOT 1
- Missing unnecessary `!` warning with nested extension types HOT 4
- Exception from yaml parsing during dart fix HOT 1
- http library throws `HttpException: Connection closed before full header was received` without a stack trace HOT 4
- [analyzer_plugin]: setContextRoots event never received HOT 1
- DateTime parse function is too generic HOT 1
- `augmented()` in generative constructors needs additional compile-time checks
- Macro with explicit "dart:core" import doesn't work HOT 1
- Not able to close/release RawDatagramSocket after receiving a SocketException in Windows Desktop HOT 2
- Weird error: The argument type 'Object' can't be assigned to the parameter type 'Object'. HOT 4
- ZLibDecoder regression in 3.5.0 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sdk.