From c803a15f6c7472b5c2d78a6f2c2e5131e77af031 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 3 Jul 2024 13:43:31 -0700 Subject: [PATCH 1/2] Clarify when Client.close must be called --- pkgs/http/lib/src/client.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/http/lib/src/client.dart b/pkgs/http/lib/src/client.dart index dace470a75..5c2da2fed6 100644 --- a/pkgs/http/lib/src/client.dart +++ b/pkgs/http/lib/src/client.dart @@ -148,8 +148,10 @@ abstract interface class Client { /// Closes the client and cleans up any resources associated with it. /// - /// It's important to close each client when it's done being used; failing to - /// do so can cause the Dart process to hang. + /// Some clients may maintain a pool of network connections that will not + /// be disconnected until the client is closed. This may cause programs run + /// using the Dart SDK (but **not** the Flutter SDK) to not terminate until + /// the client is closed. /// /// Once [close] is called, no other methods should be called. If [close] is /// called while other asynchronous methods are running, the behavior is From 815087a1888395bd9ac0f27b6ca05d3f719db1f2 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Wed, 3 Jul 2024 15:13:00 -0700 Subject: [PATCH 2/2] Review fixes --- pkgs/http/lib/src/client.dart | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/http/lib/src/client.dart b/pkgs/http/lib/src/client.dart index 5c2da2fed6..6de5698104 100644 --- a/pkgs/http/lib/src/client.dart +++ b/pkgs/http/lib/src/client.dart @@ -148,10 +148,11 @@ abstract interface class Client { /// Closes the client and cleans up any resources associated with it. /// - /// Some clients may maintain a pool of network connections that will not - /// be disconnected until the client is closed. This may cause programs run - /// using the Dart SDK (but **not** the Flutter SDK) to not terminate until - /// the client is closed. + /// Some clients maintain a pool of network connections that will not be + /// disconnected until the client is closed. This may cause programs using + /// using the Dart SDK (`dart run`, `dart test`, `dart compile`, etc.) to + /// not terminate until the client is closed. Programs run using the Flutter + /// SDK can still terminate even with an active connection pool. /// /// Once [close] is called, no other methods should be called. If [close] is /// called while other asynchronous methods are running, the behavior is