Re: autopacking twice?
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 23, 2014, 10:57 UTC
- Message-ID
- <CACsJy8D3cz9w9RrVLcRgz+xgw0+2B9G_BAotvVzUoJ9Uf-Zoag@mail.gmail.com>
- In-Reply-To
- <20140622055154.GA13819@redhat.com>
On Sun, Jun 22, 2014 at 12:51 PM, Michael S. Tsirkin <mst@redhat.com> wrote:
Show 7 quoted lines
> Why did it auto-pack twice in a single pull? > None of the changes applied are very large. > > Guess: auto-packing was started in background, did not > complete in time, and was restarted for the second time? > If true, some kind of lock file would be useful > to prevent this.
There is a lock, $GIT_DIR/gc.pid. However we are prepared to deal with stale locks, and may have slipped somehow. The test is in builtin/gc.c, lock_repo_for_gc(). Oh wait, we check for lock (and exit if lock exists) _after_ we print the message (in cmd_gc). That might be it.. If it so, maybe we can reorder some code to prevent this bogus message, but has to be careful and do it before daemonizing..
-- Duy