<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/104945/">http://git.reviewboard.kde.org/r/104945/</a>
     </td>
    </tr>
   </table>
   <br />


<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 Konsole.</div>
<div>By Jekyll Wu.</div>







<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;">This is just another immauture fix. 

The root cause of the freeze is within the readCurrentDir() method, or more precisely, the usage of QFileInfo. Clearly, both QFileInfo::isReadble() and QFile::isSymlink() requires accessing the file system, and when the related path is in an unaccessible state(like the broken ssh connection when using sshfs), the main thread is frozen and konsole hangs.

So the straight forward fix is moving those code accessing filesytems into its separate thread. I'm not good at thread, so the patch is ugly. But it seems to does the expected job. Now konsole UI is still responsive under the same condition.

However, the patch only does half the job. The problem is the separate threads are never really stopped after accessing broken path. Qt keeps complaining "QThread: Destroyed while thread is still running" and a few minute later it becomes "QThread::start: Thread creation error: " . And after the latter messages appear, all features relying knowing the current path stop working. Clearly, those problematic threads are not really destroyed.

So here it is. Although this patch makes sure the konsole UI won't be frozen, the result is not good enough yet.


[What need to do]

   * investigate whether it is theoretically and practically impossible to really destroy those problematic threads. 

   * If possible,  find out why the current code fail to do that.

   * if it is just impossible, find a way to limit its impact. For example, after encountering more than 10 failed attempts in a row, mask the attempt of reading current path for a long enough time.


[A simple test case]

$ mkdir -p /tmp/fusemount/iso
$ fuseiso some-random.iso /tmp/fusemount/iso
$ kill -STOP `pidof fuseio`
$ cd /tmp/fusemount/iso

</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=251351">251351</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>src/ProcessInfo.h <span style="color: grey">(5eb48d3)</span></li>

 <li>src/ProcessInfo.cpp <span style="color: grey">(dbe11cb)</span></li>

</ul>

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




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




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