On 05/23/12 22:35, Tim Foster wrote:
Hi Brock,

On 05/24/12 03:53 PM, Brock Pytlik wrote:
On 05/13/12 22:35, Tim Foster wrote:
https://cr.opensolaris.org/action/browse/pkg/timf/sysrepo-config-cache/sysrepo-config-cache-webrev

Thanks for taking a look.

sysrepo.py
line 317, 365 Nit: use open instead of file (at least I think we settled
on open)

Good point, thanks - I'll switch to open. We seem to use both in the gate, but open is predominant.

line 326: shouldn't this also generate an error? or do we hit this if no
publishers are configured?

You're right, it should report the error, I'll add that.

434,435,437: Why the change from tuples to lists?

The version of simplejson we have always converts tuple to lists:

>>> import simplejson
>>> import StringIO
>>> s = StringIO.StringIO()
>>> o = ["list with tuples", ("foo", "bar")]
>>> simplejson.dump(o, s)
>>> s.seek(0)
>>> s.read()
'["list with tuples", ["foo", "bar"]]'
>>> s.seek(0)
>>> simplejson.load(s)
['list with tuples', ['foo', 'bar']]
>>>

The simplejson.dump() option 'tuple_as_array' comes in version 2.2.0 which I think would solve this, but we use 2.1. In this case, switching to lists is fine I think.

Could you discuss briefly what happens in the situation where a user
adds a (currently) unreachable publisher with --no-refresh? (And perhaps
add a test case for it)

There's basically no change to the current behaviour: the cache file gets deleted, and system repository service will get restarted - if pkg.sysrepo manages to timeout before the service hits the SMF start (or refresh) method timeout, then we write a new cache, and continue serving requests.
Aaah, I'd seen but forgotten that the cache gets deleted by imageplan, that solves all the issues I was worried about below.

I wonder if we could detect that we were getting 403's to unconfigured urls within the apache framework and then use mod_wsgi or something else to restart our service, which would reduce the issue of a zone being able to do a DOS attack on the GZ. However, that's clearly outside the scope of this bug (and probably borders on insanity), so I'm happy with things as they are. It might be worth adding a comment somewhere in sysrepo.py which explains that the cache gets removed in image.save_config.

Thanks for clearing up my confusion,
Brock
[snip]

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

Reply via email to