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
F13274404: D21423.diff
Fri, May 31, 3:39 AM
F13261667: D21423.diff
Mon, May 27, 1:18 AM
F13229110: D21423.diff
Mon, May 20, 2:27 PM
F13213267: D21423.diff
Fri, May 17, 7:34 AM
Unknown Object (File)
Tue, May 7, 5:53 AM
Unknown Object (File)
Mon, May 6, 11:15 PM
Unknown Object (File)
Mon, May 6, 4:20 PM
Unknown Object (File)
May 3 2024, 3:33 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