[Sugar-devel] [PATCH sugar-0.84] journal scan of external media

Tomeu Vizoso tomeu at sugarlabs.org
Tue Sep 7 07:06:21 EDT 2010


On Tue, Sep 7, 2010 at 05:03, James Cameron <quozl at laptop.org> wrote:
> I've noticed that on Sugar 0.84 at least, inserting external media such
> as a USB HDD, flash drive, or SD card with an entire operating system on
> it is an unpleasant experience:
>
> 1.  the progress bar stutters; does not smoothly update,
>
> 2.  the progress bar may not go away, depending on whether the
> filesystem contains unreadable directories, (dev.laptop.org #10140)
>
> 3.  the shell.log contains a huge amount of errors.
>
> The stutter is caused by the overall design ... one pass through the top
> level directory is made, then for each directory in that one gobject
> idle task is created, and so on recursively.
>
> On a filesystem containing Ubuntu 10.04, for instance, with 6249
> directories, 48732 files, and 18317 symlinks, the number of gobject idle
> tasks reaches several thousand ... each of which are serviced once
> before GTK+ is permitted to do a progress bar graphics update.
>
> The code may as well have just recursed right where it was; with this
> number of idle tasks there's very little point in using idle tasks.
>
> The failure of the progress bar to go away is addressed in one of the
> attached patches.  It's just a failure to count down, caused by an idle
> task throwing an exception without decrementing a counter.
>
> A cause of the huge amount of errors is the presence of recursive
> symlinks:
>
>        /usr/bin/X11 -> .
>
> ... which causes the scan to iterate through the same directory as many
> times as it can until the number of links in the path exceeds some
> implementation limit.
>
> This is addressed in the second of the attached patches.
>
> Discussion desired.

Both look good to me, though I cannot ack for 0.84.

I would suggest logging something in the except block, we should do it
always when the exception we are bailing out from isn't very specific.

Unrelated to these patches, if the idle handlers are indeed preventing
the UI from updating then we should lower their priority.

Regards,

Tomeu

> --
> James Cameron
> http://quozl.linux.org.au/
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>


More information about the Sugar-devel mailing list