[Konsole-devel] Review Request: Make sure konsole does not get frozon due to broken filesystem

Jekyll Wu adaptee at gmail.com
Mon May 14 17:04:55 UTC 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/104945/
-----------------------------------------------------------

Review request for Konsole.


Description
-------

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


This addresses bug 251351.
    http://bugs.kde.org/show_bug.cgi?id=251351


Diffs
-----

  src/ProcessInfo.h 5eb48d3 
  src/ProcessInfo.cpp dbe11cb 

Diff: http://git.reviewboard.kde.org/r/104945/diff/


Testing
-------


Thanks,

Jekyll Wu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20120514/4cda17fd/attachment.html>


More information about the konsole-devel mailing list