Skip to content

HttpClient drops requests silently #34477

@microdog

Description

@microdog

While using http package in our Flutter app, we find that HTTP requests may be dropped silently when [HttpClient.maxConnectionsPerHost] is set and network connections are disabled. After enabling network connections, requests are still being dropped.

After tracing into the library, we find that this might be a bug in the Dart SDK. The number of connecting connections are counted incorrectly in _ConnectionTarget:

https://github.com/dart-lang/sdk/blob/bb56d4592f/sdk/lib/_http/http_impl.dart#L1940

_connecting is increased before connectionTask.then(), and the error of connectionTask is not handled. I think _connecting should be decreased when connectionTask completed with error.

The related issue in http package(including reproducing steps and demo): dart-lang/http#176 (comment)

Flutter Version:

Flutter 0.8.5-pre.5 • channel master • https://github.com/flutter/flutter.git
Framework • revision 1ad538e454 (30 hours ago) • 2018-09-14 16:47:28 -0700
Engine • revision 24d94601b9
Tools • Dart 2.1.0-dev.4.0.flutter-bb56d4592f

Metadata

Metadata

Assignees

Labels

area-core-librarySDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.library-_httptype-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions