Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix shallow root maintenance during fetch#6846

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethomson merged 1 commit intolibgit2:mainfromkcsaul:fix/setup_shallow_roots
Jul 10, 2024

Conversation

kcsaul
Copy link
Contributor

Fixes issue where the shallow roots array size wasn't being copied as part of preparing to perform a fetch.

This resulted in the shallow roots file being removed unexpectedly at the end of the fetch, even though there's still one or more shallow root commits as they weren't included/ancestors of the branches/commits fetched, which subsequently led to invalid/missing object errors.

@ethomson
Copy link
Member

Hmm, sounds right, but it looks like you've uncovered a memory leak. 🤔

@kcsaulkcsaulforce-pushed thefix/setup_shallow_roots branch from93071a0 toa5f3380CompareJuly 9, 2024 06:58
@kcsaulkcsaulforce-pushed thefix/setup_shallow_roots branch froma5f3380 to9e40c13CompareJuly 9, 2024 11:25
@kcsaul
Copy link
ContributorAuthor

@ethomson - Could you please have another look at this?

I believe the memory leak you'd spotted was a knock-on impact of an existing test failing due to the fix. I've updated the online::shallow::shorten_four test to reflect what git does when fetching with depth 5, and then 4 afterwards. It doesn't actually remove the original set of shallow roots, presumably because they're not traversed on the server during the subsequent fetch. It's not until git gc is run the unreachable shallow roots are removed.

Now that I've realized where to add a new test - I've added one to prove existing shallow roots will be preserved during fetch for an unrelated branch, and that they'll be removed as expected during subsequent fetches.

Outstanding/failing test appears to be one of the flaky network tests.

@ethomson
Copy link
Member

I believe the memory leak you'd spotted was a knock-on impact of an existing test failing due to the fix. I've updated the online::shallow::shorten_four test to reflect what git does when fetching with depth 5, and then 4 afterwards. It doesn't actually remove the original set of shallow roots, presumably because they're not traversed on the server during the subsequent fetch. It's not until git gc is run the unreachable shallow roots are removed.

Ah, that makes sense. Perfect, thanks so much. 🙏

kcsaul reacted with thumbs up emoji

@ethomsonethomson merged commitdb5b9f5 intolibgit2:mainJul 10, 2024
18 of 19 checks passed
@ethomsonethomson added the bug labelSep 29, 2024
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@kcsaul@ethomson

[8]ページ先頭

©2009-2025 Movatter.jp