Shawn, Tim, Thanks for looking into this and providing your comments.

In the case of output of the form:
"Removing metadata 1/100"
writing code to compute the goal, i.e. the exact no. of directories removed, is not worth as it will again add on to the performance.

As per the bug, the no. of metadata to be removed is huge:

edp@mcescher$ du -sh /a/var/pkg/publisher/solaris
 3.2G   /a/var/pkg/publisher/solaris
edp@mcescher$ find /a/var/pkg/publisher/solaris -type f | wc -l
  107422
edp@mcescher$ find /a/var/pkg/publisher/solaris -type d | wc -l
    2385

In such cases, as suggested by Shawn something like below would be good enough.
# pkg unset-publisher solaris
PHASE                                          ITEMS
Updating package cache                           1/1

IMO we could add an additional jobitem and use it while calling the progress tracker which would display "Removing package metadata" instead of " Updating package cache".
The output would look something like:
# pkg unset-publisher solaris
PHASE                                          ITEMS
Removing package metadata                        1/1

Is it fine to add this Job item?

Regarding the changes for 15771543, I would remove the check present and see if additional changes needs to be done.

Will send the webrev once I have the changes tested.

Thanks,
Thejaswini K

Oracle
Thejaswini K
Revenue Product Engineering (RPE), Systems
Phone: +91 8066927709 | Mobile: +91 9663324594
ORACLE India | Off Langford Road | Bangalore | 560025
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to developing practices and products that help protect the environment

On 02/11/13 02:45, Tim Foster wrote:
On 02/ 9/13 08:12 AM, Shawn Walker wrote:
On 02/07/13 19:15, Tim Foster wrote:
"Removing metadata 1/100"

The problem with that idea is that we don't know how much metadata there
is to remove and since we're not actually removing the metadata
piece-by-piece (we use rmtree) we can't provide meaningful progress for
each metadata item as it is removed.

We do have some visibility into what we're removing, in some parts of the code[1] we're iterating over several directories looking for candidate directories to remove, calling shutil.rmtree when we need to.

Some shutil.rmtree calls will take longer than others, I'd rather a counter telling me how many directory-trees of content to consider removing are left, than just a random spinning '|/-\|-\'.

You're right in that when we're removing an entire publisher (line 3422), we've no visibility into the metadata removal, but not with the rest of the code (perhaps in that case, metadata removal is so fast it's not worth considering emitting progress?)

    cheers
            tim

[1] http://src.opensolaris.org/source/xref/pkg/gate/src/modules/client/image.py#3424 ish
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to