Execute traces for all non-Return values #4118

Merged
merged 2 commits into from Dec 5, 2016

Conversation

Projects
None yet
3 participants
@stuhood
Member

stuhood commented Dec 5, 2016

Problem

Currently, Noops are not returned across the native boundary, and thus aren't traced during a failure. Noops can occur for a few reasons, but the most user-facing of those reasons are build graph cycles.

Solution

Rather than executing traces only when we see a Throw, execute it in all non-Return cases, which handles Noops and other unexpected conditions.

Rather than executing traces only when we see a Throw, execute it in …
…all non-Return cases, which handles Noops and other unexpected conditions.
@kwlzn

kwlzn approved these changes Dec 5, 2016

lgtm

@@ -77,12 +77,10 @@ def _index(self, roots):
# Index the ProductGraph.
for node, state in roots.items():
- if type(state) is Throw:
+ if type(state) is not Return:
trace = '\n'.join(self._scheduler.trace())
raise AddressLookupError(
'Build graph construction failed for {}:\n{}'.format(node, trace))

This comment has been minimized.

@kwlzn

kwlzn Dec 5, 2016

Member

it would probably also be useful to log the value of state here?

@kwlzn

kwlzn Dec 5, 2016

Member

it would probably also be useful to log the value of state here?

@baroquebobcat

LGTM.

Is this covered by existing tests? If not do you think it'd be valuable to add one?

@stuhood stuhood merged commit 54991cc into pantsbuild:master Dec 5, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@stuhood stuhood deleted the twitter:stuhood/trace-for-all-failures branch Dec 5, 2016

lenucksi added a commit to lenucksi/pants that referenced this pull request Apr 25, 2017

Execute traces for all non-Return values (#4118)
### Problem

Currently, `Noop`s are not returned across the native boundary, and thus aren't traced during a failure. Noops can occur for a few reasons, but the most user-facing of those reasons are build graph cycles.

### Solution

Rather than executing traces only when we see a Throw, execute it in all non-Return cases, which handles Noops and other unexpected conditions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment