KDevelop project file manager: watch directories exclusively, avoid concurrent reloads and represent jobs in the RunController (PoC)
Needs ReviewPublic

Authored by rjvbb on Nov 26 2017, 3:12 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary
  • Watch directories exclusively as this is the only viable cross-platform compatible method unless the user set KDEV_PROJECT_INTREE_DIRWATCHING_MODE.

When watching directories, take into consideration that 1) a notification can come from a new or changed hidden file; 2) many changes can be signalled in rapid succession and 3) notifications are about changes in the given directory (= not in any of its subdirs).
Nothing can be done about 1) but the other 2 points are taken into account:

  • queue reloads (with a rather arbitrary 1s cool-off delay) instead of starting them at once.
  • reloads due to change notifications are marked disposable
  • when another notification arrives for a directory that's already reloading (or scheduled for), abort the current job(s) where possible (or skip the directory if it's a subdir) before creating the new job. Consider only "disposable" jobs for this.
  • when the notification is about an already known directory the reload will be non-recursive.
  • file manager list jobs are registered with the RunController.
Test Plan

Does what it's intended to do, tested while running configure on a bigger in-tree build project (e.g. CodeBlocks).
Dir watching works also on Mac if you don't set watches on all files; the effect of reload-limiting is clear from following CPU usage in top, from fan noise, and from the RunController buttons turning on in the toolbar for only short periods of time.

Tested on Mac and Linux.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
Build Status
Buildable 8541
Build 8559: arc lint + arc unit
rjvbb created this revision.Nov 26 2017, 3:12 PM
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptNov 26 2017, 3:12 PM
rjvbb requested review of this revision.Nov 26 2017, 3:12 PM
rjvbb planned changes to this revision.

(Setting "plan changes" because I don't think this needs to show up in "review queues".)

rjvbb updated this revision to Diff 52073.Feb 19 2019, 3:01 PM
rjvbb edited the test plan for this revision. (Show Details)

Time to rebase this proof-of-concept and restore its full scope, for reference even if only parts ever get upstreamed (there was a blocking disagreement last time).

rjvbb retitled this revision from KDevelop project file manager: avoid concurrent reloads and represent jobs in the runController to KDevelop project file manager: watch directories exclusively, avoid concurrent reloads and represent jobs in the RunController (PoC).Feb 19 2019, 3:01 PM
rjvbb edited the summary of this revision. (Show Details)
rjvbb edited the test plan for this revision. (Show Details)
rjvbb set the repository for this revision to R32 KDevelop.
rjvbb added a project: KDevelop.