Similar to #56978, if a git upload-pack is run in the repo while it is being actively cloned via p4-fusion, git corruption can happen.
git upload-pack is called by executors when they need to clone a repo to do a job. The executor runs git fetch which goes through its git proxy, turning into info/refs and upload-pack. git upload-pack spawns a git pack-objects process, which disrupts the refs so that p4-fusion can't continue.
================
From @bfurtonmw:
gitserver itself has an HTTP endpoint like this: http://gitserver-0.gitserver/{repo/path}/git-upload-pack
From the source, this endpoint runs git upload-pack, which calls git pack-objects under the hood.
When git gc runs, it also calls git pack-objects under the hood via git repack.
Here's a cleaned-up ps sample showing git gc and git upload-pack running together, albeit in different folders:
Reproducing this behavior depends on an alignment of jobs, currently (working on a way to reproduce manually), so it takes some trial and error.
set up a Perforce code host with some depots in it. Use fusionClient with settings that cause frequent small updates instead of infrequent, large updates:
Overview
Similar to #56978, if a
git upload-pack
is run in the repo while it is being actively cloned viap4-fusion
, git corruption can happen.git upload-pack
is called by executors when they need to clone a repo to do a job. The executor runs git fetch which goes through its git proxy, turning intoinfo/refs
andupload-pack
.git upload-pack
spawns agit pack-objects
process, which disrupts the refs so thatp4-fusion
can't continue.================ From @bfurtonmw:
gitserver
itself has an HTTP endpoint like this:http://gitserver-0.gitserver/{repo/path}/git-upload-pack
From the source, this endpoint runs
git upload-pack
, which callsgit pack-objects
under the hood.When
git gc
runs, it also callsgit pack-objects
under the hood viagit repack
.Here's a cleaned-up
ps
sample showinggit gc
andgit upload-pack
running together, albeit in different folders:In theory, the three running together in the same folder could conflict with each other.
================
@bfurtonmw also has steps to clean up the corruption manually, after which
p4-fusion
can be run again:Steps to reproduce:
Reproducing this behavior depends on an alignment of jobs, currently (working on a way to reproduce manually), so it takes some trial and error.
fusionClient
with settings that cause frequent small updates instead of infrequent, large updates:git upload-pack
.gitserver
- when you see both processes running, check for repo corruption.Expected behavior:
No issues with the repo.
Actual behavior:
The repo gets corrupted.
/cc @sourcegraph/source