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
Unknown Object (File)
Wed, Apr 24, 11:19 PM
Unknown Object (File)
Sat, Apr 20, 5:25 PM
Unknown Object (File)
Sat, Apr 20, 3:20 AM
Unknown Object (File)
Thu, Apr 11, 7:51 AM
Unknown Object (File)
Thu, Apr 11, 6:42 AM
Unknown Object (File)
Wed, Mar 27, 12:38 PM
Unknown Object (File)
Jan 9 2024, 11:11 AM
Unknown Object (File)
Jan 7 2024, 4:22 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 24794
Build 34204: Run Core Tests
Build 34203: arc lint + arc unit