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
F18678281: D21423.diff
Thu, Sep 25, 10:32 PM
F18652131: D21423.id50979.diff
Sun, Sep 21, 6:48 AM
F18630617: D21423.id.diff
Tue, Sep 16, 12:12 PM
F18623409: D21423.diff
Mon, Sep 15, 3:40 PM
F18571154: D21423.id50979.diff
Wed, Sep 10, 4:46 AM
F18571153: D21423.id50976.diff
Wed, Sep 10, 4:45 AM
F18571152: D21423.id50974.diff
Wed, Sep 10, 4:45 AM
F18460754: D21423.id50974.diff
Mon, Sep 1, 7:27 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
Lint
Lint Not Applicable
Unit
Tests Not Applicable