Do not try to cleanup the DUChain while parse jobs are running.
ClosedPublic

Authored by mwolff on Feb 21 2016, 12:10 AM.

Details

Summary

This can interfer drastically with the ongoing parse jobs. Most
notably, I just encountered a case where a long-running parse job
was ongoing, but all other parse threads where waiting since the
cleanup thread already tried to lock for write, thereby starving
the parse jobs.

I think we should wait with the cleanup until the parse jobs have
finished. To do so, we try to lock for write and give up if this
does not succeed.

Test Plan

Seems to work as I intended. On shutdown, we still wait for the jobs
and cleanup unconditionally. But while a big project is parsed, no
cleanup is taking place.

Diff Detail

Repository
R33 KDevPlatform
Branch
5.0
Lint
Lint Skipped
Unit
Unit Tests Skipped
mwolff updated this revision to Diff 2408.Feb 21 2016, 12:10 AM
mwolff retitled this revision from to Do not try to cleanup the DUChain while parse jobs are running..
mwolff updated this object.
mwolff edited the test plan for this revision. (Show Details)
mwolff added a reviewer: KDevelop.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptFeb 21 2016, 12:10 AM
kfunk added a subscriber: kfunk.Feb 21 2016, 7:29 PM

Rest LGTM, makes sense

language/duchain/duchain.cpp
687 ↗(On Diff #2408)

Nitpick: Could introduce a flag for the options (-> increases readability)

717 ↗(On Diff #2408)

Add some debug output? -> "language X still parsing, aborting cleanup"

mwolff updated this revision to Diff 2420.Feb 21 2016, 10:20 PM

attended kfunk's review

kfunk accepted this revision.Feb 21 2016, 10:28 PM
kfunk added a reviewer: kfunk.
kfunk added inline comments.
language/duchain/duchain.cpp
683

Nitpick: ///

686

Nitpick: NoLock = 0, ///< doc

Same below

This revision is now accepted and ready to land.Feb 21 2016, 10:28 PM
This revision was automatically updated to reflect the committed changes.