https://pantsbuild.org/ logo
#general
Title
# general
h

helpful-lunch-92084

11/30/2020, 6:02 PM
hey we just bumped our pants version to 2.1.1rc1 to test out the fix for https://github.com/pantsbuild/pants/issues/11201 but now running a pants test on the target that was hitting the maxrecursion limit now results in pants hanging/spinning. The last few trace logs are like the following:
Copy code
12:59:32.16 [TRACE] Completed: Inferring Python dependencies.
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: Inferring Python dependencies.
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: Inferring Python dependencies.
12:59:32.16 [TRACE] Completed: Inferring dependencies on `__init__.py` files
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
12:59:32.16 [TRACE] Completed: Resolve direct dependencies
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_unexpanded_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
12:59:32.16 [TRACE] Completed: pants.engine.internals.graph.resolve_targets
I’m running
pants -ltrace --no-pantsd test …
if there’s additional debug flags i can set to get more insight into what it’s doing let me know
h

hundreds-father-404

11/30/2020, 6:03 PM
cc @witty-crayon-22786
w

witty-crayon-22786

11/30/2020, 6:05 PM
argh. sorry folks.
h

hundreds-father-404

11/30/2020, 6:05 PM
How long did you wait before ctrl-cing? I’m curious if it does eventually evaluate. Of course, that’s not desirable to take that long to evaluate and this needs to be revisited again, but may help to understand what’s going on.
h

helpful-lunch-92084

11/30/2020, 6:05 PM
i have left it for probably over 10 minutes before hitting ctrl-c
👍 1
1
w

witty-crayon-22786

11/30/2020, 6:09 PM
that’s definitely my fault. should have reproduced the bug before attempting to fix it.
h

helpful-lunch-92084

11/30/2020, 6:09 PM
and yah the cpu gets pegged when it hits this so smells of some infinite loop
👍 1
w

witty-crayon-22786

11/30/2020, 6:10 PM
so. regarding reproducing the original issue: i’ll need a bit more information
h

hundreds-father-404

11/30/2020, 6:10 PM
What’s surprising to me is that it does evaluate in Python - doesn’t hang if you tweak the recursion limit. Iiuc, we didn’t tweak the algorithm and only ported it to Rust
h

helpful-lunch-92084

11/30/2020, 6:11 PM
yah i saw the commit, seemed straightforward enough
since we’re upgrading from an earlier version of pants and our dependencies are already explicit, would it be worthwhile to test this with dependency inference off?
w

witty-crayon-22786

11/30/2020, 6:16 PM
the thing that is glaringly missing here is an easier way to dump your entire graph of dependencies without running
./pants dependencies
once per file.
as i’m pretty sure reproducing means understanding the graph shape
h

helpful-lunch-92084

11/30/2020, 6:17 PM
i could dump the deps with --transitive for the test target no?
w

witty-crayon-22786

11/30/2020, 6:18 PM
yes, but that wouldn’t get us the intermediate graph shape… the direct dependencies involved, basically.
h

hundreds-father-404

11/30/2020, 6:18 PM
@witty-crayon-22786 the closet we have to that is
./pants dependees --transitive --output-format=json ::
, which shows per-file. Would that help? You’d need to run on 2.1.0, as the
--transitive
flag is the part triggering the cycle
w

witty-crayon-22786

11/30/2020, 6:18 PM
oh! awesome. yes, that’s exactly what we need.
h

helpful-lunch-92084

11/30/2020, 6:19 PM
ok, will do
w

witty-crayon-22786

11/30/2020, 6:19 PM
@helpful-lunch-92084: if you feel comfortable sharing a (sanitized) version of that output, and identifying the problematic target, that would be very helpful.
h

helpful-lunch-92084

11/30/2020, 6:21 PM
yah let me double check on that
fwiw with pants 2.1.1rc1 i was able to run
./pants dependencies --transitive
on the test target in question, it didn’t hang
👀 1
w

witty-crayon-22786

11/30/2020, 6:23 PM
h

hundreds-father-404

11/30/2020, 6:23 PM
Interesting, huh. Was the failing command
./pants test $bad_target
? I would expect that to behave the same as
./pants dependencies --transitive $bad_target
. It should be using the exact same problematic code path
w

witty-crayon-22786

11/30/2020, 6:24 PM
if it’s sensitive, you can DM it and i can sanitize it.
h

helpful-lunch-92084

11/30/2020, 6:24 PM
ok, just curious why i would need to do it on 2.1.0?
yah that’s what i’m confused about, if it were related to dependency calculation it should fail on 2.1.1rc1
h

hundreds-father-404

11/30/2020, 6:24 PM
That command might work on 2.1.1rc1, and that’s fine if it does! I only anticipated you would get the same hang on rc1 because I suspect the code path to resolve transitive deps is what’s broken
h

helpful-lunch-92084

11/30/2020, 6:26 PM
oh i see it was dependees not dependencies
h

hundreds-father-404

11/30/2020, 6:27 PM
Yeah, but
dependees --transitive
uses the same code path as well for transitive deps as used by
test
and` dependencies --transitive`. So it’s fishy if it does not hang on rc1, but that’s useful data what happens.
h

helpful-lunch-92084

11/30/2020, 6:29 PM
yah dependees works on 2.1.1rc1 as well
i’ll dm you @witty-crayon-22786
w

witty-crayon-22786

11/30/2020, 6:30 PM
thanks a ton, and sorry for the trouble.
❤️ 1
i spent the morning using the mapping you got me to try and get a repro, but i just realized that the tack i’m on will need a rethink (i shouldn’t need your source roots or 3rdparty mappings to repro this, but the harness i had set up assumed that i could get them)… tomorrow i’ll give that a fresh go, but am going to switch to other work for a bit
thanks again for the assistance, and sorry for the delay!
if it looks like we’re going to another RC soon, i can revert the previous “fix” so that your workaround will be fixed.
h

helpful-lunch-92084

11/30/2020, 10:59 PM
it’s ok, we can revert to 2.1.0 in the meantime
3 Views