Memory Leak Risk in Dart Future.wait eagerError: No Automatic Cancellation of Pending Futures
0 reputation · 21 Feb 2021, 07:28 UTC
Goal
Determine whether the Dart `Future.wait` API with `eagerError:true` should automatically cancel remaining pending futures to prevent resource retention.
Constraints and Uncertainty
The current implementation does not guarantee cancellation of the other futures, and the language specification leaves the cancellation semantics undefined, meaning behavior may vary across Dart versions and runtimes.
What specific behavior change is desired for `eagerError:true` regarding pending futures?
Should an additional cancellation mechanism be introduced, or is manual cancellation the intended approach?
How will this affect long‑running server‑side Dart applications and memory usage guarantees?