Skip to content
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

Linux: How are the background task started/managed? #501

Closed
ykoehler opened this issue Mar 29, 2021 · 11 comments · Fixed by #503
Closed

Linux: How are the background task started/managed? #501

ykoehler opened this issue Mar 29, 2021 · 11 comments · Fixed by #503

Comments

@ykoehler
Copy link

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?

@derrickstolee
Copy link
Contributor

derrickstolee commented Mar 29, 2021

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.

@ykoehler
Copy link
Author

That is quite interesting... My 'crontab -l' contains nothing related to git, I will investigate further.

@ykoehler
Copy link
Author

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.

@derrickstolee
Copy link
Contributor

derrickstolee commented Mar 30, 2021

@ykoehler: that is interesting. scalar register should definitely be doing that, I think. Could you do a few things for me?

  1. Run scalar version.
  2. Run git version.
  3. Run GIT_TRACE2_PERF=$(pwd)/trace2.txt scalar register and then attach that trace2.txt file here. Feel free to remove any identifiers from that file. Alternatively, send it to me via email: @github.com.

Thanks!

@ykoehler
Copy link
Author

ykoehler commented Mar 31, 2021

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

@derrickstolee
Copy link
Contributor

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.)

@ykoehler
Copy link
Author

Hi, yes, I was building scalar from source, since there is no RPM for Scalar for CentOS7.
trace2.txt

@derrickstolee
Copy link
Contributor

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.

derrickstolee added a commit that referenced this issue Mar 31, 2021
…1.0+

Resolves #501.

The feature flag was originally introduced in cd0e476 (#398) but at that time we didn't know if the core Git client was ready, so we didn't enable it for versions of Git that did not include the `.vfs.` platform.

Fix this since background maintenance is now available on all platforms on v2.31.0 and later.
@derrickstolee
Copy link
Contributor

(Just a note that this issue is closed because the fix is in the main branch. It has not been released yet.)

@ykoehler
Copy link
Author

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.

@derrickstolee
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants