<table><tr><td style="">bruns created this revision.<br />bruns added reviewers: Baloo, ngraham, astippich, poboiko.<br />Herald added projects: Frameworks, Baloo.<br />Herald added a subscriber: kde-frameworks-devel.<br />bruns requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D21709">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>When the 'delete' flag is set, the file was removed from the index and<br />
the item was removed from the pending file queue (<tt style="background: #ebebeb; font-size: 13px;">m_cache</tt>). When a<br />
'created' event arrives before the queue has been processed, the flag<br />
was merged into the queue item, but never processed (delete + create),<br />
i.e. the file was omitted from the index.</p>
<p>In case a created/modified file was moved to the <tt style="background: #ebebeb; font-size: 13px;">m_pendingFiles</tt> queue<br />
(files to be reindexed later) and deleted, the pending files timer may<br />
fire before <tt style="background: #ebebeb; font-size: 13px;">process</tt> is run, and the <tt style="background: #ebebeb; font-size: 13px;">indexNewFile</tt>/<tt style="background: #ebebeb; font-size: 13px;">indexModifiedFile</tt><br />
signal is emitted for a no longer existing file. Although this is handled<br />
in the indexer, this causes unnecessary work.</p>
<p>Emit the <tt style="background: #ebebeb; font-size: 13px;">removeFileIndex</tt> immediately and remove the file from all<br />
queues.</p>
<p>A deleted file/folder is kept in the m_recentlyEmitted list, to avoid<br />
excessive events when e.g. a temporary file is created/deleted in short<br />
period of time.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p><tt style="background: #ebebeb; font-size: 13px;">$> date > testfile; rm testfile; date > testfile</tt><br />
After the change, testfile is included in the index</p>
<p><tt style="background: #ebebeb; font-size: 13px;">$> date > testfile; date > testfile2; usleep 2000; rm testfile</tt><br />
After the change, <tt style="background: #ebebeb; font-size: 13px;">indexNewFile</tt> signal is emitted only for testfile2,<br />
while for testfile <tt style="background: #ebebeb; font-size: 13px;">removeFileIndex</tt> is emitted.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R293 Baloo</div></div></div><br /><div><strong>BRANCH</strong><div><div>fix_races</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D21709">https://phabricator.kde.org/D21709</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>src/file/pendingfile.cpp<br />
src/file/pendingfilequeue.cpp</div></div></div><br /><div><strong>To: </strong>bruns, Baloo, ngraham, astippich, poboiko<br /><strong>Cc: </strong>kde-frameworks-devel, LeGast00n, domson, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams<br /></div>