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)
Mon, Dec 16, 6:25 AM
Unknown Object (File)
Tue, Dec 10, 10:38 AM
Unknown Object (File)
Sat, Dec 7, 7:24 AM
Unknown Object (File)
Sat, Nov 30, 4:04 AM
Unknown Object (File)
Sun, Nov 24, 8:48 PM
Unknown Object (File)
Nov 22 2024, 2:27 AM
Unknown Object (File)
Nov 21 2024, 7:44 AM
Unknown Object (File)
Nov 17 2024, 4:29 AM
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