Skip to content
This repository has been archived by the owner on Sep 9, 2020. It is now read-only.

Allow invalid lock version to be added to the Q #986

Merged
merged 1 commit into from
Aug 11, 2017

Conversation

carolynvs
Copy link
Collaborator

What does this do / why do we need it?

When the version from the lock is immediately discarded due to not matching the constraint, nothing is logged and it's not clear that the lock was broken, or why. Allowing it be be added to the version queue lets it be evaluated first, traced and clearly show why it wasn't used.

I originally tried to log directly in getLockVersionIfValid but it caused the trace to look out of order, since that is called before the top level line is printed for the package being evaluated.

What should your reviewer look out for in this PR?

I don't think so.

Do you need help or clarification on anything?

I wasn't sure if there was an existing gps unit test/fixture I could piggy back on to validate this new behavior, short of testing the output in a harness test. If not, I'll add a harness test and just check the output.

Which issue(s) does this PR fix?

This is related to #939, so that at least something is logged when the lock is broken.

@carolynvs carolynvs requested a review from sdboyer August 9, 2017 22:52
@carolynvs carolynvs force-pushed the warn-lock-break branch 2 times, most recently from 64e065f to 736d143 Compare August 9, 2017 22:54
Copy link
Member

@sdboyer sdboyer left a comment

Choose a reason for hiding this comment

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

oh, yes! totally a good call. small tweak on the impl, but this is definitely worth doing.

@@ -987,11 +985,8 @@ func (s *solver) getLockVersionIfValid(id ProjectIdentifier) (Version, error) {
//}
}

if !found {
// No match found, which means we're going to be breaking the lock
s.b.breakLock()
Copy link
Member

Choose a reason for hiding this comment

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

We still want this call, as this is what triggers prefetching of everything that's in the root lock, but hasn't already been selected. All that really needs dropping is the return nil, nil.

@sdboyer
Copy link
Member

sdboyer commented Aug 10, 2017

side note - at some point i want to improve the version queues to have fully separate slots for locked and preferred versions, rather than just sticking them in with the rest of the queue items. (or somehow annotate them as being different). this would let us provide better feedback in the trace output.

When the version from the lock is immdiately discarded
due to not matching the constraint, nothing is logged
and it's not clear that the lock was broken. Allowing it
be be added to the version queue, lets it be evaluated first,
traced and clearly show why it wasn't used.
@carolynvs
Copy link
Collaborator Author

1-line PR accomplished! 😎

@sdboyer sdboyer merged commit 49510d8 into golang:master Aug 11, 2017
@carolynvs carolynvs deleted the warn-lock-break branch October 6, 2017 15:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants