Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UUIDRequest scoping. #10780

Merged
merged 2 commits into from Sep 15, 2020
Merged

Conversation

jsirois
Copy link
Member

@jsirois jsirois commented Sep 15, 2020

Even though the scoping test previously passed, tests in the wild
confirm A fixed scope would generate a new UUID on each ./pants
invocation against a stable pantsd. This is fixed with an arguably
simpler model that doubles down on UUIDs while we're there.

[ci skip-rust]
[ci skip-build-wheels]

Even though the scoping test previously passed, tests in the wild
confirm A fixed scope would generate a new UUID on each ./pants
invocation against a stable pantsd. This is fixed with an arguably
simpler model that doubles down on UUIDs while we're there.

[ci skip-rust]
[ci skip-build-wheels]
@jsirois
Copy link
Member Author

jsirois commented Sep 15, 2020

I can't understand why the old session-scoped test passed but session-scoping with a fixed 0.0 value in production code demonstrably did not work under pantsd. If anyone has insights (@stuhood?) I'm somewhat lazily stumped.

@jsirois
Copy link
Member Author

jsirois commented Sep 15, 2020

FYI: This was / will be used to make #10779 as fast as current Pants under Pantsd runs 2+.

src/python/pants/engine/internals/uuid.py Show resolved Hide resolved
src/python/pants/engine/internals/uuid.py Show resolved Hide resolved
@staticmethod
def _to_scope_name(scope: UUIDScope) -> str:
if scope == UUIDScope.PER_CALL:
return uuid.uuid4().hex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. This works because you're creating a distinct Request object each time. Neat.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old code was ~doing this via random so it was a bit weird - both @_uncacheable_rule and uncacheable because effectively unique request objects.

# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
@coveralls
Copy link

coveralls commented Sep 15, 2020

Coverage Status

Coverage remained the same at 0.0% when pulling 14ec7ad on jsirois:uuid/fix-session-scope into bfd65d8 on pantsbuild:master.

@jsirois
Copy link
Member Author

jsirois commented Sep 15, 2020

I'm going to submit this to move #10779 along, but I'll be eager to hear an explanation of the prior bug if anyone can find it.

@jsirois jsirois merged commit ed6cf39 into pantsbuild:master Sep 15, 2020
@jsirois jsirois deleted the uuid/fix-session-scope branch September 15, 2020 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants