-
Notifications
You must be signed in to change notification settings - Fork 551
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
Potential fix: Correctly shrink vec into a box #5904
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Shrink the vec into a box correctly, so that it can be serialized and propagated correctly.
@mtsgrd I was not able to consistently reproduce the locking message not showing up. What I did find out was that the message doesn't show up because the file has the property My guess is that the reason for this inconsistent condition is that the |
@@ -53,7 +53,7 @@ impl VirtualBranchHunk { | |||
hunk: GitHunk, | |||
hash: Digest, | |||
mtimes: &mut MTimeCache, | |||
locked_to: &[HunkLock], | |||
locked_to: Box<[HunkLock]>, |
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.
There is a bit of desperation here and I'd be surprised if this affects the serialisation. It will affect the runtime though, so I'd hope this can be done without enforcing an extra clone.
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.
@Byron Yeah, the justification for this is that it used to be this way (cloning it too) before implemented by someone else and my guess is that when I changed it I introduced a race condition.
I do indeed don't know for certain whether this fixes that, though.
Also, I'm not sure I can box the vec without cloning it.
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 won't merge this until I'm sure this is the source of the condition.
I'm rather surprised that serialisation was being problematic with the slice. @Byron is there anything serde related that you might know of that could be causing this? |
Shrink the vec into a box correctly, so that it can be serialized and propagated correctly.