<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/108950/">http://git.reviewboard.kde.org/r/108950/</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;">This is indeed the source of the bug, and the patch fixes it - I wrote something similar independently last night.</pre>
 <br />









<p>- Simeon</p>


<br />
<p>On February 14th, 2013, 7:57 a.m. UTC, Vishesh Handa wrote:</p>








<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Nepomuk and Simeon Bird.</div>
<div>By Vishesh Handa.</div>


<p style="color: grey;"><i>Updated Feb. 14, 2013, 7:57 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;">    FileIndexer: Do not use QDirIterators in the queues
    
    A DirIterator works by opening the directory (as a file) and reading its
    contents, which are the list of files in that directory. As long as the
    dirIterator is open, it consumes one file descriptor.
    
    When iterating over all the folders, by using QDirIterator, we open a
    new file descriptor per directory. Since we traverse the file system via
    breadth first, the number of valid QDirIterators can get quite high.
    This sometimes results in us exceeding the number of file descriptors
    required which results in a crash, cause QProcess doesn't handle running
    out of file descriptors.
    
    Instead we now just iterate over all the directories and store them as
    strings. This may consume more memory, but it is better than a crash.
    
    BUG: 310777
</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;">Checked the number of open file descriptors via `ls -l /proc/PID/fd/`. It remains constant with this patch, earlier it used to increase significantly based on the directory structure. </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=310777">310777</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/fileindexer/basicindexingqueue.h <span style="color: grey">(5d1c190)</span></li>

 <li>services/fileindexer/basicindexingqueue.cpp <span style="color: grey">(b581786)</span></li>

</ul>

<p><a href="http://git.reviewboard.kde.org/r/108950/diff/" style="margin-left: 3em;">View Diff</a></p>







  </td>
 </tr>
</table>








  </div>
 </body>
</html>