Giter Club home page Giter Club logo

Comments (8)

matanlurey avatar matanlurey commented on August 17, 2024

I might check with the flutter CLI folks to see how they handle it.

from sdk.

dart-github-bot avatar dart-github-bot commented on August 17, 2024

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.

devoncarew avatar devoncarew commented on August 17, 2024

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.

bkonyi avatar bkonyi commented on August 17, 2024

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.

christopherfujino avatar christopherfujino commented on August 17, 2024

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.

christopherfujino avatar christopherfujino commented on August 17, 2024

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.

matanlurey avatar matanlurey commented on August 17, 2024

If I trace the code, it eventually gets to <IOClient>.close(), which does a .close(force: true), which should cancel pending requests.

from sdk.

christopherfujino avatar christopherfujino commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.