While updating my test instance today I noticed a bunch of
warnings from python-bugzilla like this:
Bug 1371338 missing attribute 'flags' - doing implicit refresh().
This will be slow, if you want to avoid this, properly use
query/getbug include_fields, and set bugzilla.bug_autorefresh =
False to force failure.
This happens in update_milestone() in bug_sync. We do a mass
query for newbugs then call self.extract_information() on
each individual bug. That in turn looks at the bug's flags to
determine whether needinfo is set. But it appears that, by
default, the flags are not included in the result of the mass newbugs query, so python-bugzilla is doing an extra individual
query for each bug to get the flags. This is obviously slow and
produces needless load on the server.
To avoid this, it seems that we can just specify extra_fields
in the code that ultimately produces the query we use to get newbugs. That way each newbug already has its flags and no
re-query is necessary.
While updating my test instance today I noticed a bunch of
warnings from python-bugzilla like this:
Bug 1371338 missing attribute 'flags' - doing implicit refresh().
This will be slow, if you want to avoid this, properly use
query/getbug include_fields, and set bugzilla.bug_autorefresh =
False to force failure.
This happens in
update_milestone()
in bug_sync. We do a massquery for
newbugs
then callself.extract_information()
oneach individual bug. That in turn looks at the bug's flags to
determine whether
needinfo
is set. But it appears that, bydefault, the flags are not included in the result of the mass
newbugs
query, so python-bugzilla is doing an extra individualquery for each bug to get the flags. This is obviously slow and
produces needless load on the server.
To avoid this, it seems that we can just specify
extra_fields
in the code that ultimately produces the query we use to get
newbugs
. That way eachnewbug
already has its flags and nore-query is necessary.
Signed-off-by: Adam Williamson awilliam@redhat.com