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

Re: git update-ref --stdin : too many open files

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Dec 23, 2014, 03:22 UTC
Message-ID
<20141223032228.GZ29365@google.com>
In-Reply-To
<5498D66B.5090807@gmail.com>
Hi Stefan,
Stefan Beller wrote:
> On 22.12.2014 13:22, Junio C Hamano wrote:
>> Loic Dachary <loic@dachary.org> writes:
>>> fatal: Unable to create /home/gitmirror/repositories/Ceph/ceph/refs/heads/pull/1917.lock': Too many open files
[...]
Show 5 quoted lines
>> Stefan, want to take a look?  I think we do need to keep the .lock
>> files without renaming while in transaction, but we do not have to
>> keep them open, so I suspect that a fix may be to split the commit
>> function into two (one to close but not rename, the other to
>> finalize by renaming) or something.
Makes sense.
> Sounds reasonable. Though by closing the file we're giving up again a
> bit of safety. If we close the file everyone could tamper with the lock
> file. (Sure they are not supposed to touch it, but they could)

At least on Linux, keeping a file open doesn't offer any protection against someone else deleting it. (It also doesn't offer any protection against someone updating the ref directly. ;-) Opening the corresponding .lock file with O_EXCL is part of the contract for updating refs.)

Thanks, Jonathan

Previous: Stefan BellerNext: Junio C Hamano
Message 4 of 8 in “git update-ref --stdin : too many open files”
  1. Loic DacharyDec 20, 2014
  2. Junio C HamanoDec 22, 2014
  3. Stefan BellerDec 23, 2014
  4. Jonathan NiederDec 23, 2014
  5. Junio C HamanoDec 23, 2014
  6. Stefan BellerDec 24, 2014
  7. Michael HaggertyDec 29, 2014
  8. Stefan BellerDec 29, 2014

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.