[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: KDirWatch bug and the analysis. Help is welcome!
From:       Mark <markg85 () gmail ! com>
Date:       2013-07-31 23:30:08
Message-ID: CAPd6JnGEsUJ4JVossTcrBqyD1_fR1_DV-F3ujUXC93_e-4nkXQ () mail ! gmail ! com
[Download RAW message or body]

On Thu, Aug 1, 2013 at 12:25 AM, Milian Wolff <mail@milianw.de> wrote:

> On Wednesday 31 July 2013 20:51:11 Mark wrote:
> > Hi,
> >
> > I'm horrible in clearly explaining issues and i'm going to explain a
> > lot in this mail. Please read it very carefully.
>
> <snip>
>
> > Subsequent signals (even create, delete or anything besides dirty) is
> > following this same path where the emit is being triggered from
> > KDirWatchPrivate::slotRescan in the above mentioned snippet. All
> > signals are thus being send as dirty signals! For more clarity, this
> > is what KDirLister(Cache) actually receives (in
> > KDirListerCache::slotFileDirty) as signals for the same folder:
> > (DIRTY signal) /home/mark/massive_files
> > (DIRTY signal) /home/mark/massive_files/.directory.lock
> > (DIRTY signal) /home/mark/massive_files/.directorym13357.new
> > (DIRTY signal) /home/mark/massive_files (yes, it starts with this and
> > ends with this)
> >
> > Now i'm guessing this isn't right. All dirty signals of which two(!!)
> > are my main folder.
>
> Besides that it's two times that signal, imo this is what should be done.
> Creating/Removing a file makes its parent folder dirty.
>
> If that needs to happen then there is no change needed since that is
currently happening which i think is a bug.
If there is no way to detect which files inside a directory have been
created/added/modified then it indeed is best to just mark the whole
directory as dirty thus cause a complete re-scan. That is what happens now.

However, we have been given the power of inotify which gives more detailed
signals and lets us know which files have been created/added/modified which
we should be used imho.


> Maybe KDirListerCache should not listen on dirty but rather on created and
> deleted instead, which should come with the semantics you describe?
>

The dirty signal handling is not wrong, the signals it gets are. it's
receiving a signal to many that already causes a full re-scan. It would
probably be fine if it just received the signals that inotify is
broadcasting:

(CREATE signal) /home/mark/massive_folder/.directory.lock
(MODIFY signal) /home/mark/massive_folder/.directory.lock
(CREATE signal) /home/mark/massive_folder/.directoryc13357.new
(MODIFY signal) /home/mark/massive_folder/.directoryc13357.new
(DELETE signal) /home/mark/massive_folder/.directoryc13357.new
(CREATE signal) /home/mark/massive_folder/.directory
(DELETE signal) /home/mark/massive_folder/.directory.lock


> Bye
> --
> Milian Wolff
> mail@milianw.de
> http://milianw.de
>

[Attachment #3 (text/html)]

<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Thu, Aug 1, \
2013 at 12:25 AM, Milian Wolff <span dir="ltr">&lt;<a href="mailto:mail@milianw.de" \
target="_blank">mail@milianw.de</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div \
class="im">On Wednesday 31 July 2013 20:51:11 Mark wrote:<br>


&gt; Hi,<br>
&gt;<br>
&gt; I&#39;m horrible in clearly explaining issues and i&#39;m going to explain a<br>
&gt; lot in this mail. Please read it very carefully.<br>
<br>
</div>&lt;snip&gt;<br>
<div class="im"><br>
&gt; Subsequent signals (even create, delete or anything besides dirty) is<br>
&gt; following this same path where the emit is being triggered from<br>
&gt; KDirWatchPrivate::slotRescan in the above mentioned snippet. All<br>
&gt; signals are thus being send as dirty signals! For more clarity, this<br>
&gt; is what KDirLister(Cache) actually receives (in<br>
&gt; KDirListerCache::slotFileDirty) as signals for the same folder:<br>
&gt; (DIRTY signal) /home/mark/massive_files<br>
&gt; (DIRTY signal) /home/mark/massive_files/.directory.lock<br>
&gt; (DIRTY signal) /home/mark/massive_files/.directorym13357.new<br>
&gt; (DIRTY signal) /home/mark/massive_files (yes, it starts with this and<br>
&gt; ends with this)<br>
&gt;<br>
&gt; Now i&#39;m guessing this isn&#39;t right. All dirty signals of which \
two(!!)<br> &gt; are my main folder.<br>
<br>
</div>Besides that it&#39;s two times that signal, imo this is what should be \
done.<br> Creating/Removing a file makes its parent folder dirty.<br>
<br></blockquote><div>If that needs to happen then there is no change needed since \
that is currently happening which i think is a bug.</div><div>If there is no way to \
detect which files inside a directory have been created/added/modified then it indeed \
is best to just mark the whole directory as dirty thus cause a complete re-scan. That \
is what happens now.</div>

<div><br></div><div>However, we have been given the power of inotify which gives more \
detailed signals and lets us know which files have been created/added/modified which \
we should be used imho.</div><div> </div><blockquote class="gmail_quote" \
style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



Maybe KDirListerCache should not listen on dirty but rather on created and<br>
deleted instead, which should come with the semantics you \
describe?<br></blockquote><div><br></div><div>The dirty signal handling is not wrong, \
the signals it gets are. it&#39;s receiving a signal to many that already causes a \
full re-scan. It would probably be fine if it just received the signals that inotify \
is broadcasting:</div>

<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">(CREATE \
signal) /home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directory.lock</span><br \
style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">(MODIFY signal) \
/home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directory.lock</span><br \
style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">(CREATE signal) \
/home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directoryc13357.new</span><br \
style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">(MODIFY signal) \
/home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directoryc13357.new</span><br \
style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">(DELETE signal) \
/home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directoryc13357.new</span><br \
style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">(CREATE signal) \
/home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directory</span><br \
style="font-family:arial,sans-serif;font-size:13px">

<span style="font-family:arial,sans-serif;font-size:13px">(DELETE signal) \
/home/mark/massive_folder/.</span><span \
style="font-family:arial,sans-serif;font-size:13px">directory.lock</span><br \
style="font-family:arial,sans-serif;font-size:13px">

</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><blockquote \
class="gmail_quote" style="margin:0px 0px 0px \
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">



<br>
Bye<br>
<span class=""><font color="#888888">--<br>
Milian Wolff<br>
<a href="mailto:mail@milianw.de">mail@milianw.de</a><br>
<a href="http://milianw.de" target="_blank">http://milianw.de</a><br>
</font></span></blockquote></div><br></div></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic