Check metrics and decide if need to context cancel the running git process in addPackRefsInhibitor
The WAL tries to add a transaction, but it could fail to do this when there are existing stale reference locks. To go around this, we invoke housekeeping to clean up the stale reference locks. While doing this we add an inhibitor, so that git-pack-refs(1) doesn't run concurrently at the same.
If git-pack-refs(1) is already running when we try to add the inhibitor, we currently wait for it to exit. The more performant solution is to kill the ongoing process, since transactions take priority over git-pack-refs(1). Check if we need to do this and ensure we don't end up in a bad state by killing the git process mid-way.