Hello,
I have identified why the startup of PM is so slow after changes:

def __get_publisher_timestamp(self, publisher):
        import time
        a = time.time()
        dt = self.api_o.get_publisher_last_update_time(prefix=publisher)
        print time.time() - a
        if dt:
                return dt.ctime()
        return dt

This result in:
bash-3.2$ pfexec python packagemanager.py
8.41350483894

Which means that we are loosing 8 seconds. Before this function took less then 0.0001.

So if it will be still so slow, we will need to revert back to using the old one.

The working webrev is at:
 http://cr.opensolaris.org/~migi/webinstall_v2/

This webrev contains shared gladefile for changes with the beadm rework, so if you will apply only this one, the be management will print stack trace. To fix this applay the patch:
http://cr.opensolaris.org/~migi/6975_be_rework/src/gui/modules/beadmin.py.patch

Also the below bugs and limitations are in this webrev (like no nick name), but I think there is a bug in the api in that situation.

This includes:
 - weird dialog window / error (the dialog was destroyed and then show())
 - fix for core dump - this I believe was the result of above bug.

I will log a bug for:
 - user image created with --no-refresh causes startup error:

best
Michal

Michal Pryc wrote:
Shawn,
I got it working, but there are few bugs and limitations:

* If the p5i do not contain repository information we are skipping this p5i file and do nothing as the publisher returned from the api is None for such situation. So it would be hard to tell from which publisher this package comes from, eg.
---------------------
{
  "packages": [
    "pkg:/[email protected],5.11-0",
    "baz"
  ],
}
---------------------

* The p5i file can't contain alias information or we will get exception:
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.4/threading.py", line 442, in __bootstrap
    self.run()
  File "/usr/lib/python2.4/threading.py", line 422, in run
    self.__target(*self.__args, **self.__kwargs)
File "/usr/lib/python2.4/vendor-packages/pkg/gui/repository.py", line 879, in __add_repository
    self.api_o.add_publisher(pub)
File "/usr/lib/python2.4/vendor-packages/pkg/client/api.py", line 861, in add_publisher
    self.img.add_publisher(pub, refresh_allowed=refresh_allowed)
File "/usr/lib/python2.4/vendor-packages/pkg/client/image.py", line 743, in add_publisher
    if pub == p or (pub.alias and pub.alias == p.alias):
AttributeError: 'str' object has no attribute 'alias'

{
  "publishers": [
    {
      "alias": "cat",
      "name": "bobcat",
      "packages": [
        "example-1"
      ],
      "repositories": [
        {
          "collection_type": "core",
          "description": "xkcd.net/325",
          "legal_uris": [
            "http://xkcd.com/license.html";
          ],
          "mirrors": [],
          "name": "source",
          "origins": [
            "http://localhost:10000/";
          ],
          "refresh_seconds": 43200,
          "registration_uri": "",
          "related_uris": []
        }
      ]
    }
  ],
  "version": 1
}

* The p5i file which worked for me:
{
  "publishers": [
    {
      "name": "bobcat",
      "packages": [
        "example-1"
      ],
      "repositories": [
        {
          "collection_type": "core",
          "description": "xkcd.net/325",
          "legal_uris": [
            "http://xkcd.com/license.html";
          ],
          "mirrors": [],
          "name": "source",
          "origins": [
            "http://localhost:10000/";
          ],
          "refresh_seconds": 43200,
          "registration_uri": "",
          "related_uris": []
        }
      ]
    }
  ],
  "version": 1
}


best
Michal

Shawn Walker wrote:
Michal Pryc wrote:
Hello,
I have merged all the gui changes together and posted at:
http://cr.opensolaris.org/~migi/webinstall_v1/

This patch should be applied on top of the:
http://cr.opensolaris.org/~swalker/pkg-5871
 (note this webrev is missing filelist.py)

I've found a few bugs when testing this patch applied as described above:

======================================================================
core dump
======================================================================
-- start packagemanager
-- go to file -> manage repositories
-- ensure that there are two repositories listed (i haven't tested with more than that, results may vary) -- using keyboard, navigate to repository list (tab key) and highlight first entry
-- using keyboard, go to second repository entry (down arrow)
-- using keyboard, trigger modify dialog (Alt + M)
-- using keyboard, close modify dialog (Escape)
-- using keyboard, trigger modify dialog (Alt + M)
-- core dump [1]

======================================================================
weird dialog window / error
======================================================================
-- start packagemanager
-- go to file -> manage repositories
-- ensure that there are two repositories listed (i haven't tested with more than that, results may vary) -- using keyboard, navigate to repository list (tab key) and highlight first entry
-- using keyboard, trigger modify dialog (Alt + M)
-- using keyboard, close modify dialog (Escape)
-- using keyboard, trigger modify dialog (Alt + M)
-- tiny dialog window comes up and following error is printed in console:
/export/home/xxx/devel/pkg-5871-gui/proto/root_i386/usr/lib/python2.4/vendor-packages/pkg/gui/repository.py:753: GtkWarning: file gtkcontainer.c: line 1476: assertion `GTK_IS_CONTAINER (container)' failed
  self.w_repositorymodify_dialog.show_all()

======================================================================
user image created with --no-refresh causes startup error:
======================================================================
-- pkg image-create --no-refresh -a test=http://ipkg.sfbay/dev /tmp/image
-- pfexec python packagemanager.py -R /tmp/image
-- received this dialog box message:

Error occured while getting list of packages

-- received this message in console output:
 Traceback (most recent call last):
  File "packagemanager.py", line 648, in __init_tree_views
    row = section_list[self.initial_section]
IndexError: could not find tree path

-- when attempting to close the packagemanager, it never closed and printed this message:

Traceback (most recent call last):
  File "packagemanager.py", line 1004, in __on_mainwindow_delete_event
    if self.__check_if_something_was_changed() == True:
File "packagemanager.py", line 1578, in __check_if_something_was_changed
    for pkg in self.application_list:
TypeError: iteration over non-sequence
======================================================================

Cheers,



_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to