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

Re: [RFC/PATCH] Documentation/technical/api-fswatch.txt: start with outline

From
Thomas Rast <trast@student.ethz.ch>
Date
Mar 16, 2013, 14:21 UTC
Message-ID
<87ehffv30f.fsf@pctrast.inf.ethz.ch>
In-Reply-To
<7vtxof146d.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 11 quoted lines
> Karsten Blees <karsten.blees@gmail.com> writes:
>
>> However, AFAIK inotify doesn't work recursively, so the daemon
>> would at least have to track the directory structure to be able to
>> register / unregister inotify handlers as directories come and go.
>
> Yes, and you would need one inotify per directory but you do not
> have an infinite supply of outstanding inotify watch (wasn't the
> limit like 8k per a single uid or something?), so the daemon must be
> prepared to say "I'll watch this, that and that directories, but the
> consumers should check other directories themselves."
Those are tunable limits though.  For example I run this silly hack
  https://github.com/trast/watch

with the shell snippets to be able to quickly cd a shell to where something recently happened. I am able to watch most of my "working set" even under default limits, which here (opensuse tumbleweed, kernel 3.8.x, x86_64) are

  $ cat /proc/sys/fs/inotify/max_user_watches 
  65536
  $ cat /proc/sys/fs/inotify/max_user_instances 
  128

I'm not sure if other distros impose tighter limits by default, but as it stands you're not very likely to hit the 65k watches limit in any given repo. It seems more likely that you might hit the 128 instances limit if we go with a design that uses one daemon per repo, if you run a script that accesses many repos. For example, in an android tree I have lying around,

  $ repo list | wc -l
  297

That alone might indicate it would be a good idea to have one "global" git-agent that starts on demand, rather than a per-repo daemon. Otherwise we'd have to find a way to discover "old" daemons and tell them to quit when we hit max_user_instances.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Pete WyckoffNext: Ramkumar Ramachandra
Message 12 of 17 in “Documentation/technical/api-fswatch.txt: start with outline”
  1. Documentation/technical/api-fswatch.txt: start with outlineRamkumar Ramachandra, Mar 10, 2013
  2. Heiko VoigtMar 11, 2013
  3. Ramkumar RamachandraMar 12, 2013
  4. Erik Faye-LundMar 12, 2013
  5. Jeff KingMar 12, 2013
  6. Karsten BleesMar 12, 2013
  7. Duy NguyenMar 13, 2013
  8. Karsten BleesMar 13, 2013
  9. Junio C HamanoMar 13, 2013
  10. Duy NguyenMar 14, 2013
  11. Pete WyckoffMar 15, 2013
  12. Thomas RastMar 16, 2013
  13. Ramkumar RamachandraMar 18, 2013
  14. Thomas RastMar 18, 2013
  15. Ramkumar RamachandraMar 25, 2013
  16. Duy NguyenMar 25, 2013
  17. Ramkumar RamachandraMar 25, 2013

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.