Linux: How are the background task started/managed?
ykoehler opened this issue · 11 comments
I have installed dotnet/scalar on my CentOS7 machine, I can execute scalar run all in the repo, I have registered my repo. Yet, from the documentation, I do not get how scalar will be able to run in the background to fetch/pack/etc. my repos. Is there a service I need to setup, or when git is called, somehow scalar spawn its task in the background?
Scalar on Linux and macOS runs git maintenance start
, part of Git's maintenance feature. It schedules maintenance tasks according to the maintenance.strategy = incremental
config option.
You can inspect the way Git schedules its process runs by running crontab -l
on Linux.
That is quite interesting... My 'crontab -l' contains nothing related to git, I will investigate further.
I think there is a problem with "scalar register", the git config of my repo was modified, but no task appeared under crontab -l. I then executed "git maintenance start" and those tasks then showed up. Likely, 'scalar register' is missing that call, or documentation is unclear that we need to execute 'git maintenance start' in addition to 'scalar register' to get things going.
@ykoehler: that is interesting. scalar register
should definitely be doing that, I think. Could you do a few things for me?
- Run
scalar version
. - Run
git version
. - Run
GIT_TRACE2_PERF=$(pwd)/trace2.txt scalar register
and then attach thattrace2.txt
file here. Feel free to remove any identifiers from that file. Alternatively, send it to me via email: @github.com.
Thanks!
Running on CentOS7
$ scalar version
scalar 0.2.173.2
$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
remote = origin
merge = refs/heads/master
$ GIT_TRACE2_PERF=$(pwd)/trace2.txt scalar register
Successfully registered repo at '/work/ion/officeconnect-portal-manager'
$ git --version
git version 2.30.1
$ cat ~/.gitconfig
[user]
name = Yannick Koehler
[pull]
rebase = true
[diff]
submodule = log
[status]
submodulesummary = 1
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[git-p4]
largeFileSystem = GitLFS
largeFileThreshold = 100m
Hi, @ykoehler. It appears your trace upload got mangled somehow. Could you try that again?
Also, it looks like you are building Scalar from source, is that right? (If not, then we made a mistake when building the installer.)
Hi, yes, I was building scalar from source, since there is no RPM for Scalar for CentOS7.
trace2.txt
Thanks so much for this report, @ykoehler. I forgot to add to our logic in Scalar that detects if the feature is available for the non-.vfs.
versions of Git (those versions are available at https://github.com/microsoft/git/releases).
The fix is in #503. You'll need to upgrade to Git 2.31.0 before it will work, since that is the first release where all platforms had working background maintenance.
(Just a note that this issue is closed because the fix is in the main
branch. It has not been released yet.)
Great, but... somehow I can do "git maintenance start" using 2.30.1 and it adds the cron job and seems to be working nicely... But, I will seek out to upgrade my git client.
The issue is that the macOS and Windows versions of git maintenance start
were not ready in v2.30.x. They were available in v2.31.0, and that is now out so there is only a slight value in picking out that one major version on one platform. Thanks for understanding.