Files
Wez Furlong 6ead93f4e9 watchman: reap idle watches after 5 days
Summary:
adds `idle_reap_age_seconds` to .watchmanconfig and the global
configuration.  It defaults to 5 days.

A watch is considered to be idle when it has had no filesystem
notifications or commands that operate on it for idle_reap_age_seconds.
If an idle watch has no triggers and no subscriptions then it will be
cancelled, releasing the associated operating system resources, and
removed from the state file.

This is pretty straightforward in terms of implementation.  I suspect
the most difficult thing will be on agreeing to a decent value for
the global default.

I picked 5 days to allow for the reasonably common case where someone
might be idle over a weekend and busy for the first couple of days in
a week before they pick up where they left off.

I suspect that the Ember folks would prefer to use a smaller value by
default, so that their large number of discrete watches can be pruned
more aggressively.  I believe that desire will be largely mitigated once
ember has migrated to use `watch-project`.

Refs: https://github.com/facebook/watchman/issues/63

Test Plan:
`make integration`.

`tests/integration/test_age_watch.py` asserts that we won't reap while triggers or subscriptions are registered.

I also manually tested this with a 300 second
limit on a temporary dir and verified that the state file is correctly updated.

Reviewers: sid0

Reviewed By: sid0

Subscribers: stefanpenner

Differential Revision: https://reviews.facebook.net/D37701
2015-08-02 23:41:19 -07:00
..
2014-08-11 12:56:53 -07:00
2014-05-17 10:03:39 -07:00
2014-05-17 10:03:39 -07:00
2015-06-30 00:27:23 -07:00
2014-05-16 12:48:25 -07:00