Page MenuHomePhabricator

Give Futures clearer start/end and exception semantics
ClosedPublic

Authored by epriestley on Jul 23 2020, 5:07 PM.
Tags
None
Referenced Files
F19512964: D21423.id50976.diff
Tue, Jan 13, 5:42 AM
F19066127: D21423.id50976.diff
Nov 30 2025, 4:46 AM
F19050345: D21423.diff
Nov 27 2025, 7:45 PM
F19050291: D21423.diff
Nov 27 2025, 7:33 PM
F19050256: D21423.diff
Nov 27 2025, 7:28 PM
F18840149: D21423.diff
Oct 27 2025, 9:40 PM
F18817261: D21423.id50974.diff
Oct 21 2025, 1:58 PM
F18732906: D21423.diff
Sep 30 2025, 8:29 PM
Subscribers
None

Details

Summary

Ref T13555. Currently:

  • If an exception is raised in "start()", the exception state is not set on the future.
  • Futures do not always call "startFuture()" before starting, and do not always call "endFuture()" once they become resolvable.
  • If you start an ExecFuture which immediately fails and then call "getPID()" on it, you get an unclear exception.

Simplify these behaviors:

  • In FutureIterator, only start futures which have not already started.
  • When starting a future on any pathway, run start code.
  • When a future becomes resolvable on any pathway, run end code.
  • Raise a more clear exception when calling "getPID()" on a future with no subprocess.
Test Plan

Faked a failing subprocess with "$proc = null", ran "bin/phd debug taskmaster" etc. Got clearer errors and more consistent future lifecycle workflows.

Diff Detail

Repository
rARC Arcanist
Branch
future1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 24796
Build 34208: Run Core Tests
Build 34207: arc lint + arc unit