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
Fix UUIDRequest scoping. #10780
Conversation
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]
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. |
FYI: This was / will be used to make #10779 as fast as current Pants under Pantsd runs 2+. |
@staticmethod | ||
def _to_scope_name(scope: UUIDScope) -> str: | ||
if scope == UUIDScope.PER_CALL: | ||
return uuid.uuid4().hex |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]
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. |
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]