This is an archive of the discontinued Mercurial Phabricator instance.

watchman: disable fsmonitor when running non-interactively
AbandonedPublic

Authored by lothiraldan on Jan 15 2019, 11:57 AM.

Details

Reviewers
indygreg
Group Reviewers
hg-reviewers
Summary

One of the risks with activating fsmonitor globally is resource exhaustion
(like inotify watches on Linux).

When launching background-jobs, it's often better to not activate fsmonitor in
order to conserve resources for future interactive commands launched by users.

This can be overridden with the environment variable HGWATCHMAN_ENABLE

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

lothiraldan created this revision.Jan 15 2019, 11:57 AM
indygreg requested changes to this revision.Jan 16 2019, 2:50 PM
indygreg added a subscriber: indygreg.

Why wouldn't we want automated, non-interactive tools to have the benefits of watchman? There are plenty of use cases where complex Mercurial operations are scripted and would benefit from watchman.

Your commit message details an issue that I assume you encountered in the wild. Are there other ways we can work around this? Perhaps we can set the idle timeout/shutdown interval of watchman to be much smaller when Mercurial is non-interactive?

This revision now requires changes to proceed.Jan 16 2019, 2:50 PM

Why wouldn't we want automated, non-interactive tools to have the benefits of watchman? There are plenty of use cases where complex Mercurial operations are scripted and would benefit from watchman.
Your commit message details an issue that I assume you encountered in the wild. Are there other ways we can work around this? Perhaps we can set the idle timeout/shutdown interval of watchman to be much smaller when Mercurial is non-interactive?

Yes what we saw in the wild is background jobs taking all the resources making interactive commands slower for users.

I'm not sure what are the others workaround for this, I don't know if tuning the timeout / shutdown might be useful.

There is also the possibility to put it behind a config knob.

lothiraldan abandoned this revision.Feb 13 2019, 11:22 AM