On 03/ 8/12 08:06 AM, [email protected] wrote:
On Wed, Mar 07, 2012 at 05:39:11PM +1300, Tim Foster wrote:
Ok, I've had another go at this, and have a webrev at:
https://cr.opensolaris.org/action/browse/pkg/timf/poisoned-cache-v3
Thanks for making these modifications. I like this change.
No problem at all - the changes you suggested did result in nicer code imho.
Just a few nits:
stats.py:
- line 320: typo "operaiton" should be "operation"
Thanks, fixed.
transport.py:
- lines 1870-1874: The TransportFailures object is designed to
accumulate multiple exceptions, and pretty-print them once we reach
the maximum number of retries. Unless I've misunderstood what
you're trying to accomplish, it looks like this could be simplified
to the following:
except tx.InvalidContentException, e:
repostats.record_error(content=True)
failures.append(apx.InvalidDepotResponseException(
d.get_url(), "Unable to parse "
"repository's versions/0 response"))
Yep, that looks ok, and I'll make the change, but it might actually be
overkill. I was trying to harden our retrieval of versions/ as much as
the other operations, but unfortunately it looks like getting a bad
versions/ response anywhere really ruins pkg(1)'s day.
Very early on, we look for it in the middle of __gen_repo(..) and bail
out on the first instance of a corrupt version response, skipping all
subsequent retries and all of the additional logic I'm introducing here :-(
I'm inclined not to worry too much about this particular case, unless
folks feel we ought to be doing better here (as is, the system
repository won't try to cache versions/ responses, so that base should
be covered)
cheers,
tim
ps. found and fixed the test problem I was facing yesterday - my test
was doing "pkg install foo" but not taking into account that when other
tests had been run, the latest version of foo in the repo wasn't
necessarily the one I had published.
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss