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

Re: [JGIT PATCH 3/4] Cap the number of open files in the WindowCache

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Mar 17, 2009, 22:59 UTC
Message-ID
<200903172359.32595.robin.rosenberg.lists@dewire.com>
In-Reply-To
<1237252570-8596-4-git-send-email-spearce@spearce.org>
tisdag 17 mars 2009 02:16:09 skrev "Shawn O. Pearce" <spearce@spearce.org>:
> If we detect a file open failure while opening a pack we halve
> the number of permitted open files and try again, until we reach
> a lower bound of 16 open files.  Needing to go lower may indicate
> a file descriptor leak in the host application.
...
Show 12 quoted lines
> +			TRY_OPEN: for (;;) {
> +				try {
> +					openFileCount++;
> +					releaseMemory();
> +					runClearedWindowQueue();
> +					wp.openCount = 1;
> +					wp.cacheOpen();
> +					break;
> +				} catch (IOException ioe) {
> +					openFileCount--;
> +					if ("Too many open files".equals(ioe.getMessage())
> +							&& maxFileCount > 16) {

The output of getMessage isn't that simple to interpret. Here it is filename+" (Too many files open)", and on other platforms it is probably something else. This goes for the message part of most exceptions thrown from platform specific code like file i/o socket i/o etc. The type of exception is a FileNotFoundException, btw.

I wonder whether  your code works on any platform.
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 6 of 9 in “Avoid using 1280 file descriptors”
  1. 0/4 Avoid using 1280 file descriptorsShawn O. Pearce, Mar 17, 2009
  2. 1/4 Refactor WindowCache.reconfigure() to take a configuration objectShawn O. Pearce, Mar 17, 2009
  3. 2/4 Update EGit plugin to use WindowCacheConfigShawn O. Pearce, Mar 17, 2009
  4. 3/4 Cap the number of open files in the WindowCacheShawn O. Pearce, Mar 17, 2009
  5. 4/4 Teach WindowCacheConfig to read core.packedgit* settings from configShawn O. Pearce, Mar 17, 2009
  6. Robin RosenbergMar 17, 2009
  7. Shawn O. PearceMar 17, 2009
  8. Robin RosenbergMar 18, 2009
  9. 3/4 Cap the number of open files in the WindowCacheShawn O. Pearce, Mar 18, 2009

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.