arxanas / git-branchless

High-velocity, monorepo-scale workflow for Git

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Operations randomly hang and consume tons of memory

williewillus opened this issue · comments

Description of the bug

Operations such as git prev or git checkout --detach hang and consume tons of memory (>10G).

If I SIGINT the process and check git status, it appears the operation went through.

Expected behavior

Not hang

Actual behavior

Hang

Version of rustc

1.65

Automated bug report

report.txt

Version of git-branchless

No response

Version of git

No response

Probably related to #937.
I tried uninstalling branchless and reinstalling it into the repo but the problem still persists.

The process hanging has command line git-branchless hook reference-transaction committed

Hi @williewillus, do you notice git-branchless printing a lot of output lines saying that it processed new references/branches? You can also try applying #913 to see if it improves the behavior of the reference-transaction hook.

Can you also say how big your packed-refs file is, i.e. wc -l .git/packed-refs?

If you are working with a large repository, the problem might not be with the reference transactions, but instead with working copy snapshots. You can try disabling branchless.undo.createSnapshots and see if it helps.

commented

I'm having the same issue. My .git/packed-refs is 136 lines. Disabling branchless.undo.createSnapshots didn't seem to help either.

commented

re-installing git branchless via cargo fixed my issue.

@williewillus does git smartlog complete in a reasonable amount of time? It might just be the post-operation smartlog printing which is using too much time and memory, as it's not efficiently implemented (see #937).

@williewillus unfortunately, I don't have time lately to debug git-branchless issues. If you want to investigate yourself, you can follow the profiling section of the runbook: https://github.com/arxanas/git-branchless/wiki/Runbook#profiling and see what operation is taking too long.

Is it possible this is an issue in v0.7.0 (the latest released to crates.io and installed via cargo install) which was later fixed?

I ran into this today with v0.7.0 but installing from the repo master (6dcdd06) works fine.

@williewillus want to try building from source as per the above comment? You can see the installation instructions here: https://github.com/arxanas/git-branchless/wiki/Runbook#global-installation

Just to add another datapoint: git-branchless 0.7.0 ends up consuming >20G of memory and eventually have to kill it when it doesn't finish 30m later on a repo of mine, but completes successfully and quickly once installing the latest git.

@edwintorok what versions of Git were you running before and after?

@arxanas sorry I should've been clearer by 'the latest git' I meant 'the latest version of git-branchless from git'.
The version of git (the tool) is unchanged: 2.41.0, I've changed the version of git-branchless from 0.7.0 to latest git-branchless https://github.com/arxanas/git-branchless#2bf7e754