git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Limit file descriptors used by packs

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 28, 2011, 20:38 UTC
Message-ID
<7vwrkjhp27.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1298924835-23413-1-git-send-email-spearce@spearce.org>
"Shawn O. Pearce" <spearce@spearce.org> writes:
> ...  The output file is opened by pack-objects after
> object enumeration and delete compression are done, ...
s/delete/deflate/, I guess.
Show 15 quoted lines
> diff --git a/sha1_file.c b/sha1_file.c
> index d949b35..8863ff6 100644
> --- a/sha1_file.c
> +++ b/sha1_file.c
> @@ -708,9 +713,35 @@ static int open_packed_git_1(struct packed_git *p)
>  	if (!p->index_data && open_pack_index(p))
>  		return error("packfile %s index unavailable", p->pack_name);
>  
> +	if (!pack_max_fds) {
> + ...
> +		if (lim.rlim_cur < lim.rlim_max) {
> +			lim.rlim_cur = lim.rlim_max;
> +			if (!setrlimit(RLIMIT_NOFILE, &lim))
> +				max_fds = lim.rlim_max;
> +		}

This is somewhat questionable, isn't it? We don't know why the user chose to ulimit the process yet forcibly bust that limit without telling him?

Other than that it looks sensible.  Thanks.
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 4 of 10 in “Limit file descriptors used by packs”
  1. Limit file descriptors used by packsShawn O. Pearce, Feb 28, 2011
  2. Bernhard R. LinkFeb 28, 2011
  3. Shawn O. PearceFeb 28, 2011
  4. Junio C HamanoFeb 28, 2011
  5. Shawn O. PearceFeb 28, 2011
  6. Limit file descriptors used by packsShawn O. Pearce, Feb 28, 2011
  7. Erik Faye-LundFeb 28, 2011
  8. Junio C HamanoMar 1, 2011
  9. Shawn PearceMar 1, 2011
  10. 2/1 sha1_file.c: Don't retain open fds on small packsShawn O. Pearce, Mar 2, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.