diff options
author | Brandon Casey <drafnel@gmail.com> | 2013-07-31 12:51:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-08-02 09:27:26 -0700 |
commit | 7c3ecb32541d767518bf78633603f94fefdac8cf (patch) | |
tree | bf5ca4bc5f1b7d5f0b7451e8b737c9fc1ffe4db3 /git-compat-util.h | |
parent | 88d0db55579cd2173ce641849066da8b897b58da (diff) | |
download | git-7c3ecb32541d767518bf78633603f94fefdac8cf.tar.gz |
Don't close pack fd when free'ing pack windowsbc/unuse-packfile
Now that close_one_pack() has been introduced to handle file
descriptor pressure, it is not strictly necessary to close the
pack file descriptor in unuse_one_window() when we're under memory
pressure.
Jeff King provided a justification for leaving the pack file open:
If you close packfile descriptors, you can run into racy situations
where somebody else is repacking and deleting packs, and they go away
while you are trying to access them. If you keep a descriptor open,
you're fine; they last to the end of the process. If you don't, then
they disappear from under you.
For normal object access, this isn't that big a deal; we just rescan
the packs and retry. But if you are packing yourself (e.g., because
you are a pack-objects started by upload-pack for a clone or fetch),
it's much harder to recover (and we print some warnings).
Let's do so (or uh, not do so).
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r-- | git-compat-util.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index ad4762499e..9a56484106 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -498,7 +498,7 @@ int inet_pton(int af, const char *src, void *dst); const char *inet_ntop(int af, const void *src, char *dst, size_t size); #endif -extern void release_pack_memory(size_t, int); +extern void release_pack_memory(size_t); typedef void (*try_to_free_t)(size_t); extern try_to_free_t set_try_to_free_routine(try_to_free_t); |