[prev in list] [next in list] [prev in thread] [next in thread]
List: nepomuk
Subject: Re: [Nepomuk] Review Request: Fix bug 286854 (Dolphin loses metadata when moving files)
From: "Sebastian Trueg" <sebastian () trueg ! de>
Date: 2012-11-10 9:00:39
Message-ID: 20121110090039.7870.35720 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107260/#review21759
-----------------------------------------------------------
Ship it!
Ship It!
- Sebastian Trueg
On Nov. 9, 2012, 12:53 a.m., Simeon Bird wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107260/
> -----------------------------------------------------------
>
> (Updated Nov. 9, 2012, 12:53 a.m.)
>
>
> Review request for Nepomuk, Vishesh Handa and Sebastian Trueg.
>
>
> Description
> -------
>
> Bug 286854 seems to be due to an old, no longer needed, rogue workaround.
> This patch removes the workaround.
>
> The filewatch service calls moveFileMetadata ( oldPath, newPath).
>
> This sticks the metadata move into a queue, like so:
> if ( !m_updateQueue.contains( req ) && !m_recentlyFinishedRequests.contains( req ) )
> m_updateQueue.enqueue( req );
>
> If you move oldPath to newPath twice in fairly quick succession, the first move will
> still be in the m_recentlyFinishedRequests, and the metadata move will not be queued.
>
> git blame tells me that trueg added this check with commit 840dbb6005ead in 2009.
>
> He explained why in this comment:
> // we use several systems to watch for file operations.
> // Thus, we can get the same request more than once. We then
> // need a way to determine if we have already handled it.
> // (otherwise we would remove the previously moved data.)
> // The only way to do that is to keep a list of all requests
> // that have been handled in the last N seconds.
>
>
> So far as I know, inotify cannot deliver the same event twice, and so this is no longer true.
> So we can fix the bug by just deleting all code related to the recentlyFinishedRequests list.
>
>
> This addresses bug 286854.
> http://bugs.kde.org/show_bug.cgi?id=286854
>
>
> Diffs
> -----
>
> services/filewatch/metadatamover.h 47ef497
> services/filewatch/metadatamover.cpp 468e74e
>
> Diff: http://git.reviewboard.kde.org/r/107260/diff/
>
>
> Testing
> -------
>
> Compiled, verified that it did indeed fix the bug.
>
>
> Thanks,
>
> Simeon Bird
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/107260/">http://git.reviewboard.kde.org/r/107260/</a>
</td>
</tr>
</table>
<br />
<p>Ship it!</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Ship It!</pre> <br />
<p>- Sebastian</p>
<br />
<p>On November 9th, 2012, 12:53 a.m., Simeon Bird wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/media/rb/images/review_request_box_top_bg.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for Nepomuk, Vishesh Handa and Sebastian Trueg.</div>
<div>By Simeon Bird.</div>
<p style="color: grey;"><i>Updated Nov. 9, 2012, 12:53 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Bug 286854 seems to be due to an old, no longer needed, rogue \
workaround. This patch removes the workaround.
The filewatch service calls moveFileMetadata ( oldPath, newPath).
This sticks the metadata move into a queue, like so:
if ( !m_updateQueue.contains( req ) && !m_recentlyFinishedRequests.contains( \
req ) ) m_updateQueue.enqueue( req );
If you move oldPath to newPath twice in fairly quick succession, the first move will
still be in the m_recentlyFinishedRequests, and the metadata move will not be queued. \
git blame tells me that trueg added this check with commit 840dbb6005ead in 2009.
He explained why in this comment:
// we use several systems to watch for file operations.
// Thus, we can get the same request more than once. We then
// need a way to determine if we have already handled it.
// (otherwise we would remove the previously moved data.)
// The only way to do that is to keep a list of all requests
// that have been handled in the last N seconds.
So far as I know, inotify cannot deliver the same event twice, and so this is no \
longer true. So we can fix the bug by just deleting all code related to the \
recentlyFinishedRequests list. </pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">Compiled, verified that it did indeed fix the bug. </pre> </td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=286854">286854</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>services/filewatch/metadatamover.h <span style="color: \
grey">(47ef497)</span></li>
<li>services/filewatch/metadatamover.cpp <span style="color: \
grey">(468e74e)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/107260/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
Nepomuk mailing list
Nepomuk@kde.org
https://mail.kde.org/mailman/listinfo/nepomuk
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic