[00:00] yeah, the flags package isn't as flexible as some [00:01] you have a usage() method which you can override, but from memory it doesn't have knowledge of the flags that have been defined so can't kind of convert the flag set into a usage document [00:01] hmm [00:01] actually that isn't true [00:01] it does do that [00:01] gimme two secs [00:05] bigjools: you want flag.PrintDefaults() [00:06] ok thanks [00:06] I wasn't quite sure how the Usage() thing fits it, the docs don't make it obvious [00:06] Usage is called when you pass a flag that doesn't parse or is not known [00:09] how is it overridden? [00:09] (that's the bit that wasn't obvious, sorry) [00:10] flag.Usage = func() { ... ; flag.PrintDefaults } [00:10] * thumper heads out to get a floor for the new shed... [00:11] flag.Usage = func() { ... ; flag.PrintDefaults() } [00:12] oh that was more simple than I'd expected [00:12] thanks [00:12] flag.Usage is a variable with type func() [00:13] so you can call it, with flag.Usage() [00:13] sort of like a javascript function [00:13] in a slot [01:39] wow that took a lot longer than I thought it would [01:44] wallyworld: 2013/03/27 01:43:40 ERROR JUJU:jujud:machine cmd/jujud: provisioning worker: failed to GET object provider-state from container ehmegerd-bhukett, caused by: https://region-a.geo-1.objects.hpcloudsvc.com/v1/17031369947864/ehmegerd-bhukett/provider-state%!(EXTRA string=failed executing the request), caused by: Get https://region-a.geo-1.objects.hpcloudsvc.com/v1/17031369947864/ehmegerd-bhukett/provider-state: lookup region-a.ge [01:44] ^ get that pretty constantly inside hp [01:44] can you confirm that, for you, deploying inside hp works ? [01:44] if so, then i'll push out this damnable release [01:45] davecheney: i deployed yesterday, from tip. i don't recognise that error offhand. what rev are you looking to release? i'll do a deployment and check [01:46] wallyworld: juju-core_1.9.12-3~1064~quantal1_amd64.deb [01:46] it's the usual nonsense that hp cloud cannot resolve its own endpoing internally [01:47] davecheney: i deployed a bootstrap node and also a mysql node to check the debug log stuff. you saying that hp has known issues in this area? [01:47] i have not raised an issue with hp [01:47] i can assert that deploying into hp rarely works [01:47] for me [01:47] on my accont [01:47] well that sucks [01:47] screw it [01:47] if you've had some success [01:47] that is a good enough test [01:48] i'll push out the release [01:48] well, it did work for me from source yes [01:48] but it's not good it isn't reliable [01:48] same here, have to --upload-tools for hp [01:49] davecheney: and cause i'm running raring, i need to hard code the version to precise in the code otherwise it's a pita [01:49] but upload-tools works fine if i do that [01:49] and deploy on a precise image [01:49] i don't think this is related to series [01:50] the error is related to dns name resolution [01:50] no, just mentioning for completeness [01:50] ok [01:50] full disclosure and all that [01:50] roger [01:57] davecheney: dumb question - the deb contains juju-core rev 1064. does it just pull in tip of goose trunk? what control is there over the rev nr of goose we bake in? what if we didn't want goose tip but an earlier revision? [02:06] wallyworld: the recipe does a pull from tip [02:06] there is no real control [02:06] :-( [02:06] ok [02:06] wcpgw [02:06] https://code.launchpad.net/~dave-cheney/+recipe/juju-core [02:07] ok, time to break for lunch [03:26] davecheney: ping [03:26] http://play.golang.org/p/ohvYEDuBbz, cc bigjools [03:26] thumper: /me looks [03:26] was about to do the same :) [03:27] yup [03:27] you've got two things there [03:27] 1, a typed nil [03:27] 2, you can have a method on a nil value [03:27] !!!!!!!! [03:27] err, not the right word, but you understand [03:28] madness, but ok thanks [03:29] bigjools: Go isn't like C++, there isn't a pointer to a virtual method table [03:29] you anre't really dispatching to a method [03:29] just calling a function with the receiver as the first argument [03:29] it's just syntactic tomfoolery [03:29] ohai folks, are things into a 'it now works with canonistack, no hacks involved' yet? [03:29] it still confuses me that nil turns into something else [03:29] sidnei: nope [03:30] * sidnei sets reminder for +7d [03:30] bigjools: so there are types [03:30] pointer types [03:30] and what those values point too [03:30] nil magically turns into an object [03:30] sidnei: set it for post 13.04 [03:30] ah, thanks! [03:30] sidnei: waaaaaaay past 13.04 [03:31] more like 2014? :) [03:31] bigjools: nil is just the zero value for a pointer [03:31] if you have a pointer value [03:31] *Error [03:31] actually [03:31] var e *Error [03:31] it's value is nil, (well, 0, or close too) [03:31] sidnei: probably not that bad, but the problems we have with canonistack aren't completely within the domain of Juju [03:32] so calling e.Error() [03:32] is actually doing [03:32] func Error(e *Error) String [03:32] and as nothing references the e inside that function call [03:32] it's ok that e is nil [03:32] davecheney: still the public ips thing? [03:32] sidnei: yup [03:32] :/ [03:32] ipv4 isn't going to get any less scarece [03:33] davecheney: what is InjectMachine, and what is the instanceId? [03:33] davecheney: thanks for the explanation. I have to get used to the way Go works here then. [03:33] and why does it need public ips again? [03:33] thumper: is this jeopardy ? [03:33] bigjools: no worries [03:33] davecheney: no, I was hoping you'd know [03:34] although I don't have much experience isn't this similar to how python does method dispatch ? [03:34] davecheney: so how do I rearrange my code to DWIM? [03:34] bigjools: let me loook again [03:34] I want an "error" that has more info on it [03:35] * thumper shakes his head... [03:35] InjectMachine is used in exactly one place [03:35] bootstrap [03:35] wtf [03:37] davecheney: what is the machine instance id? [03:38] davecheney: any idea? [03:38] oh... [03:38] the provider instance id [03:38] which when I'm wanting to start a new machine... [03:38] davecheney: actually I can just change foo() to return an error I think, so no worries [03:38] it should be empty right [03:38] ? [03:38] so the provider picks it up and sets it... [03:39] * thumper answered his owne question [03:39] bigjools: http://play.golang.org/p/58xsXh9GMp [03:39] maybe that wasn't what you were asking [03:39] thumper: ok, sorry, now to your question [03:40] thumper: this is bootstrapping isn't it ? [03:40] it is a bit hairy [03:40] well, inject machine is [03:40] but I was more just wondering about the instance id for the machine [03:40] but I'm pretty sure that the provider sets it [03:40] when the machine has been started [03:41] davecheney: that's pretty much it, thanbks [03:41] bigjools: np [04:12] davecheney: I've almost forced this code into the shape I want [04:12] almost... [04:12] sometimes I think we are being too clever :) [04:14] davecheney: in what situations does the transaction runner return txn.ErrAborted ? [04:15] thumper: i do not know the answer to that [04:15] davecheney: kk [04:15] soz [04:20] davecheney: shouldn't really panic should I? [04:21] davecheney: perhaps just return an error that says "shouldn't really get here, oops" [04:23] if it really is impossible, then panic sounds good [04:24] well, it could be an edge case I haven't thought of [04:25] id would expect pushback in the review [04:26] lets see :) [04:27] I need tests anyway [04:27] ... [04:27] added state.Unit.AssignToNewMachine() [04:31] ok, tests later... [04:31] like.. tomorrow [04:31] ciao === _mup__ is now known as _mup_ [07:49] morning all [08:03] dimitern, heyhey [08:06] evening [08:07] * thumper decided to get the tests done now, so first round of reviews can happen before I leave for easter [08:09] rogpeppe: you around? [08:11] sort [08:16] Oops, sorry about that. [08:19] morning fwereade [08:19] thumper, heyhey [08:19] fwereade: I'm just writing the tests for the assign to new machine in one transaction work [08:20] fwereade: which includes the AssignNew policy [08:20] thumper, ok, cool [08:20] fwereade: I'm up now so I can get a first review of it before I stop for easter :) [08:20] thumper, much appreciated :) [08:23] fwereade: actually I have a few questions... [08:23] thumper, g+ in about 5 mins ok for you? [08:23] fwereade: let me poke this with a stick first :) [08:29] fwereade: given a state.Unit, how do you get the Machine it is running on? [08:30] fwereade: the closest I can see is DeployerName() [08:30] fwereade: which doesn't actually give me what I want [08:30] fwereade: ok to add methods? [08:33] thumper, AssignedMachineId IIRC [08:33] fwereade: ah, yes [08:34] fwereade: so what is the normal way to get a machine given an ID? [08:34] from the outside? [08:34] ie, a test package [08:34] thumper, State.Machine() takes an id [08:34] cool [08:38] fwereade: another dumb question, given a machine, how do I see what units are deployed on it? [08:38] Principles doesn't seem to be mentioned in any reasonable public method for access [08:39] thumper, Units() returns all units including subordinates [08:40] ahh... it is using the doc "principal" name, not "Principal" [08:40] thumper, if you need just the principals you could filter that by Unit.IsPrincipal() [08:40] and my search was case sensitive [08:40] fwereade: it is a test, there is only a princpal :) [08:40] thumper, cool :) [08:40] fwereade: it is testing that the machine gets the principal set as well as the unit geting the machine id set [08:40] thumper, cool [08:42] fwereade: is there an assert thingy for length of a slice? [08:42] thumper, HasLen [08:43] * fwereade realises he wants to break compatibility with the released tools within 4 hours of their release; examines his conscience [08:43] :) [08:44] * fwereade decides that the assignment policy change will do that anyway, as will a bunch of other things probably, decides not to worry about it [08:45] fwereade: hmm... you can't get the Series for a unit... [08:45] fwereade: are you expected to go through the charm? [08:45] fwereade: sorry, service? [08:45] thumper, you're not really expected to ask from outside at the unit level, describe use case a little more? [08:46] fwereade: inside the test, I want to create a machine with the correct series for the unit, to make sure it isn't claimed in AssignToNewMachine [08:46] thumper, I'd just create one with the charm's series [08:46] fwereade: to do that, I need to know the series of the unit [08:47] thumper, unit series is just a denormalised copy of the charm series [08:48] fwereade: I'm not liking the number of dots here... [08:48] let me show you. [08:48] thumper: hiya [08:51] fwereade: nm... too many returns with value,err [08:51] rogpeppe: I had a question for you [08:51] thumper: ask away [08:51] thumper, haha, automatic trainwreck protection ;p [08:51] rogpeppe: perhaps best asked over a hangout if you have time [08:51] thumper: sure [08:51] fwereade: verbose mode on [08:51] rogpeppe: shall I start one? [08:51] thumper: do you wanna start... yeah [09:12] fwereade: when updating RelationCount is it ok to also change the doc field or you're expected to call Refresh after SetCharm to get the updated value? [09:12] dimitern, it's not visible externally, and it's not going to be accurate anyway in a multi-user context [09:13] dimitern, just don't bother changing it IMO [09:13] fwereade: ok, but in tests I used Refresh and added ServiceRelationCount(svc) -> int in export_test [09:13] fwereade, dimitern: do any of the operations inspect it to decide what kind of transaction to start with? [09:13] fwereade: so testing charms always use the series "series" ? [09:14] rogpeppe: no, but it was not updated after adding new peer rels [09:14] thumper, they don;t *have* to but in parctice I think they do [09:14] ok [09:14] rogpeppe, dimitern: actually they do, but the counts are assumed in general not to be accurate [09:14] fwereade: if they're not accurate, why bother looking at them? [09:15] fwereade: that would seem to me to be a reasonable argument for refreshing the count [09:15] fwereade: personally, i think that assuming the current in-memory state is any kind of indicator of remote state is a bit bogus [09:16] rogpeppe, it might be right, and probably will be if it's a fresh object, which in practice it always is except in tests [09:17] rogpeppe, but trying to keep it accurate in a long-lived object seems pretty pointless [09:17] fwereade: fair enough [09:18] rogpeppe, the time to pay for the extra roundtrips is when we need to use them, I think [09:18] ah... seriously? no NotEqual ? [09:19] thumper: Not(Equals) [09:19] * thumper sighs [09:20] thumper: 3 more characters doesn't seem too bad to me, and it's general functionality. [09:21] if you want NotEqual: var NotEqual = Not(Equals) :-) [09:21] rogpeppe: for me it is more that it should be so commonly used, it should have its own [09:21] :) [09:21] suppose someone submits that to gocheck? [09:21] bags not [09:21] thumper: it's just sugar [09:22] rogpeppe: sugar is good [09:22] rogpeppe: half of go is sugar [09:22] thumper: and not that commonly used (20 out of 1621 uses of Equals in the code base) [09:22] for us maybe :) [09:22] thumper: really? i beg to disagree. [09:22] ok [09:23] we can disagree [09:23] thumper: there are one or two sugary bits in go (some automatic type promotions) but most is basic functionality, i think [09:25] thumper: by "sugar" i mean "something that can easily be made from a combination of other existing parts" [09:29] fwereade: what is the best way to make a unit not alive for a test? [09:29] thumper, Destroy makes it Dying [09:29] ta [09:29] thumper, EnsureDead makes it Dead (and will probably work straight-off in a test context) [09:30] thumper, Remove requires that EnsureDead has already been called and actually removes it from the db [09:30] destroy is enough, ta [09:33] fwereade, rogpeppe: I think this should be ready now, would you take a look please? https://codereview.appspot.com/8034043/ [09:33] dimitern, ack [09:47] * thumper is done [09:47] tests written, all tests currently running prior to proposing [09:47] * thumper goes to put on the kettle, tea time [09:49] fwereade: ping, read your review, so we can talk about it now [09:50] w00t [09:50] all pass [09:50] * thumper does the lbox dance [09:50] * fwereade cheers at thumper [09:50] * fwereade applauds the dance [09:50] * TheMue cheers too, because he knows that feeling [09:50] TheMue, would you start a hangout please? will join in <5m [09:51] fwereade: will do [09:53] fwereade: https://codereview.appspot.com/7845048 [09:53] and I'm logging off now [09:53] see y'all tomorrow [09:54] fwereade: i'm pinging you :) [09:55] fwereade: wanna start a hangout? [09:55] dimitern, sorry, need to chat to TheMue first [09:55] fwereade: sure, np [09:55] TheMue, here [09:55] dimitern: i'll try to be fast ;) [09:55] TheMue: no worries [09:56] fwereade: ho is started, you should have an invitation [09:57] TheMue, ah, sorry, was looking at my canonical account [10:18] dimitern, ping [10:18] fwereade: here [10:18] * fwereade starts hangout === teknico_ is now known as teknico [10:30] TheMue, dimitern: I'm just WIPing your branches for now so I can see what I'm doing on +activereviews [10:31] fwereade: sure, I noticed that :) it's a pity lbox propose doesn't do this somehow [10:31] dimitern, lbox propose -wip [10:31] fwereade: sure [10:32] fwereade: is juju destroy-machine supposed to work? [10:32] rogpeppe, depends... in what context? ;p [10:32] fwereade: I don't think -wip sets the MP to WIP [10:32] fwereade: i just tried to use it, and nothing seems to be destroyed [10:32] fwereade: the instance stubbornly remains there [10:33] dimitern, I don't think it shoudl destroy anything [10:33] rogpeppe, ok, the machine is Dead but the provisioner doesn't pick it up? [10:33] fwereade: i don't know for sure if the machine is Dead. [10:33] rogpeppe, check the machine logs maybe? [10:34] fwereade: am doing that right now [10:34] rogpeppe, cheers [10:37] fwereade: ha, i've been running this juju env for less than a day, with 3 units and the all-machines.log is already 24MB [10:38] rogpeppe, how much of that is state/watcher logs? [10:39] fwereade: first estimate: 83% [10:40] fwereade: mostly "loading new events" [10:40] fwereade: 'cos that happens every 5 seconds [10:41] rogpeppe, yeah, thought so :/ [10:42] rogpeppe, I don't want to switch off debug logging, but I don't want to see that stuff ATM, and I don't want to drop that logging either [10:43] fwereade: we should just raise the log level a bit [10:43] fwereade: well actually [10:43] rogpeppe, no, because other stuff logged at debug level *is* handy [10:43] fwereade: the "loading new events" messages could go [10:43] rogpeppe, +1 [10:43] fwereade: it's nice to see when new events actually come in [10:44] fwereade: ian and I discussed the possibility of having DEBUG messages always logged locally, but rsyslogd would only sync INFO and higher [10:44] or something like that. [10:45] jam, yeah, that would be reasonable too [10:46] fwereade: alternatively, you should be able to post-filter with "juju debug-log | grep -v DEBUG" or whatever, since all the tags should be well defined. But yeah, some of that was "tweaking as we find a good balance" [10:46] we talked about DEBUG default off, until user requested, INFO only local, Notice and above global. [10:48] fwereade: 82% of the size is from "loading new events" [10:49] rogpeppe, ok, let's just drop that one [10:49] rogpeppe: clearly that means when the logs are rotated it will trivially compress, right? :) [10:50] * rogpeppe prefers logs with greater signal to noise ration [10:53] fwereade: the log size reduces by 95% with grep -v 'loading new|synchronizing watcher' [10:53] fwereade: so i'll remove the synchronizing watcher message too [10:54] rogpeppe, jam: hmm, good point about compression actually [10:54] rogpeppe, the reason I am nervous is that I can all too easily imagine us encountering surprising watcher behaviour at scale [10:55] rogpeppe, ...but then, at scale, the sheer volume of messages may become crippling [10:55] * fwereade grumbles vaguely [10:55] fwereade: is it really worth printing log events for non-events ? [10:56] fwereade: one thing: i see many more connect requests than i would expect [10:56] rogpeppe, well, it allows us to distinguish between "nothing happened" and "the watcher is blocked" [10:56] rogpeppe, oh yes? [10:56] fwereade: like, over 4000 in the last day [10:57] rogpeppe, what exactly are you referring to by connect requests? the machine agent reconnecting to state? [10:57] fwereade: yeah. well, mgo dialling the state server, at any rate [10:58] fwereade: looks like it happens every 3 minutes [10:58] rogpeppe, that is... somewhat alarming [10:59] rogpeppe, anything obvious in the logs preceding the attempts? [10:59] fwereade: i wonder if there's a connection between that three minutes and this line in mgo: [10:59] session.SetSyncTimeout(3 * time.Minute) [10:59] hmm, no, that's in a test! [10:59] fwereade: no not AFAICSS [11:05] fwereade: ah, i think it must be const syncServersDelay = 3 * time.Minute [11:16] rogpeppe, ha, I don't recognise that at all [11:19] fwereade: indeed, when I commented out the RC++ block I started getting ErrExCont on destroy :) [11:19] dimitern, cool, my mental model remains accurate :) [11:26] fwereade: it's done and I like how the test got simplified, check it out === teknico_ is now known as teknico [11:39] rogpeppe, any idea why running go test in the juju-core/state/apiserver package might never terminate? [11:40] mattyw: it can happen that a test fails and then things hang up trying to tear down. [11:40] mattyw: (it's an issue that needs fixing) [11:40] mattyw: try running go test -gocheck.vv [11:40] mattyw: then you'll see all the test output as it happens [11:40] mattyw: so you'll know where it's hanging [11:43] rogpeppe, you're right http://pastebin.ubuntu.com/5652025/ [11:43] mattyw: ah, i suspected that actually [11:44] mattyw: you need a version of mongo that supports ssl [11:44] mattyw: i think there might be an apt repo for it, but i'm not sure. [11:44] mattyw: i got it from the s3 bucket that juju gets it from [11:45] rogpeppe, I can try installing one by hand [11:45] rogpeppe, good plan [11:45] dimitern, LGTM with trivials [11:45] everyone else, need to be hospitable for a bit until cath comes back [11:47] mattyw: http://juju-dist.s3.amazonaws.com/tools/mongo-2.2.0-precise-amd64.tgz [11:47] rogpeppe, just installing it from there [11:47] rogpeppe, thanks very much [11:47] rogpeppe, did I mention I like the api? [11:48] mattyw: i think you did. that's nice to hear! [11:48] fwereade: cheers [11:48] mattyw: what do you like about it, BTW? [11:49] rogpeppe, at the moment just the fact that a client doesn't really need to do anything to get data about units, I don't have to parse json or handle connections. I just sit on a channel [11:50] mattyw: cool. we aim to please :-) [11:51] rogpeppe, something that is confusing though is there doesn't seem to be a way for me to get ServiceInfo from a get. It would be nice to just watch the deltas for *params.UnitInfo, then for each one get the service details by doing a ServiceGet(u.Name) and get a params.ServiceInfo back [11:52] mattyw: you should see the service details too, as they arrive [11:53] mattyw: although the service will arrive in the same set of deltas as the unit of that service, there's currently no guarantee that the service will appear first in that slice. [11:53] rogpeppe, but I'll have to keep track of them myself, it could be lasier by just watching for units then asking for the data each time (although now I think about it when a unit gets remove that would be messy) [11:53] mattyw: (that was a policy decision taken because the GUI, the main consumer of the API currently, doesn't care) [11:54] rogpeppe, in fact, the more I think about it, the more I think it's best I keep track of them myself [11:54] mattyw: keeping track yourself should be easy, yeah [11:54] rogpeppe, at the moment I watch for UnitInfo and ServiceInfo [11:54] mattyw: all you need to do is keep a map[string]*params.ServiceInfo [11:54] mattyw: and assign to it when things change [11:54] rogpeppe, exactly what i'm doing [11:55] rogpeppe, good to know I'm on the right track [11:59] * TheMue enjoys a short lunch break [12:01] * dimitern lunch as well [12:01] rogpeppe, thanks, that seems to be working a treat now [12:01] mattyw: great [12:03] rogpeppe, something you might be able to answer without my trying it out. That sample you sent me yesterday. Would I be able to run that from within a deployed unit? Would it need any extra info to connect the the environment? [12:04] mattyw: from within a deployed unit, you'd need slightly different code [12:04] mattyw: this is an issue that the GUI team have too, in fact. [12:04] fwereade: what do you think of the idea of making the API server address available in an environment variable to hooks ? [12:05] fwereade: current the GUI charm is going delving in agent.conf files, which, while expedient, probably isn't a great long term solution [12:07] rogpeppe, hmm, I need to think about that for a bit [12:08] rogpeppe, definitely better than the current solution, but... :) [12:08] fwereade: what do see as the potential problems with it? === BradCrittenden is now known as bac [12:28] fwereade: oh yes, i just looked at the life status of those machines i tried to destroy - they're all dying, but nothing's reacting [12:30] rogpeppe, I'm not sure there are any problems, just hadn't really considered it [12:30] fwereade: yeah, i wondered at first, then thought "why not?" [12:31] fwereade: it's not going to be that uncommon for charms to want to talk to their juju environment in a proactive way [12:31] rogpeppe, hmm, if you bounce the machine agents do they react then? [12:32] fwereade: i'm trying to remember which part of the machine agent is responsible for setting the machine to Dead [12:32] rogpeppe, I guess the core of my unease is that we give hooks a very specific environment to work with, and giving them direct API access kinda does an end run around that [12:32] rogpeppe, the Machiner [12:32] fwereade: they only get direct API access if someone specifically tells the charm the access key [12:33] rogpeppe, true [12:33] rogpeppe, I'm still wondering whether it makes more sense as a charm config param [12:33] rogpeppe, probably not [12:34] fwereade: looks like the Machiner isn't actually started by the machine agent. oops. [12:34] rogpeppe, well, crap [12:35] rogpeppe, that*would* explain hte trouble you've been having with the live tests though [12:36] fwereade: ah! [13:02] fwereade: https://codereview.appspot.com/6938072/diff/3001/cmd/jujud/machine.go [13:02] fwereade: oops, i didn't spot it! [13:03] rogpeppe, shit happens, my fault for crappy testing [13:03] rogpeppe, IIRC we did discuss it and agreed that the complexities of the state-fuckery made it skippable [13:03] rogpeppe, but that's clearly nonsense :) [13:04] rogpeppe, except, hold on [13:04] rogpeppe, we dropped machiner then [13:04] rogpeppe, that was known [13:04] fwereade: yeah, i'm just trying to to see when it came back [13:04] rogpeppe, because machiner was trying to do deployer's job [13:04] rogpeppe, I could have sworn I put it back at some point [13:05] rogpeppe, but, maybe I just didn't [13:05] * fwereade heads off to lunch and maybe to find something to smack himself with === frankban_ is now known as frankban [13:12] rogpeppe, ping? [13:12] mattyw: pong? [13:13] rogpeppe, hi, I'm trying to write some unit tests for my api querying thing, I'm using state/apiserver/api_test.go as a guide [13:14] mattyw: ok [13:14] mattyw: that may or may not be a good idea :-) [13:15] rogpeppe, but there must be something I'm missing in the intitial setup because whenever I try to do anything in setUpScenario like AddUser, AddMachine or AddUnit I panic will a nil reference [13:15] mattyw: could you paste your code? [13:15] rogpeppe, just doing it... [13:17] rogpeppe, http://paste.ubuntu.com/5652243 [13:17] rogpeppe, I'm been just piling stuff into SetUpSuite to see what happens, each of these commands by themselves will blow up [13:18] mattyw: i'll just see what happens when i run your code [13:18] rogpeppe, ok thanks [13:22] mattyw: ok, i've found your problem [13:24] mattyw: try this: http://paste.ubuntu.com/5652259/ [13:25] mattyw: problem 1) you were defining SetUpSuite but not calling the underlying JujuConnSuite SetUpSuite. [13:26] rogpeppe, seems to run, thanks very much, I was looking for something like JujuConnSuite.SetUptest(c) but couldn't find anything [13:26] mattyw: problem 2) JujuConnSuite only provides a State for individual tests, not for the whole suite. [13:26] rogpeppe, thanks again for your help [13:26] mattyw: np [13:26] rogpeppe, ok === andrewdeane is now known as awd [13:50] fwereade: ping [13:54] rogpeppe, pong [13:54] fwereade: so... i've put Machiner back in the machine agent [13:54] fwereade: and i have a test that fails before and passes now: http://paste.ubuntu.com/5652331/ [13:55] fwereade: but... [13:55] fwereade: i don't like the test, and i'm not sure of the best way to fix it [13:55] fwereade: do you see why it's flaky? [13:56] rogpeppe, is it the 5s matching watcher refreshes? [13:56] rogpeppe, or something else? [13:56] fwereade: yeah that's it === wedgwood_away is now known as wedgwood [13:56] fwereade: if the destroy happens a little bit later, then we really can take 5s to notice [13:57] fwereade: but we can't call StartSync because we don't have access to the machiner's state [13:57] rogpeppe, check out cmd/jujud/deployer_test.go [13:57] rogpeppe, which does Bad Things to get around that problem [13:57] rogpeppe, but to be fair Worse Things have happened [13:57] fwereade: i'm wondering about a slightly more radical approach to StartSync [13:58] rogpeppe, go on... [13:58] fwereade: how about we make StartSync global? [13:58] fwereade: so it syncs *all* watchers [13:59] rogpeppe, I was afraid you were going to say that, but it is awfully tempting [13:59] rogpeppe, that'd unfuck a number of other tests I think [13:59] fwereade: this is for testing, right? [13:59] fwereade: yeah [13:59] fwereade: and i can't really see much of a down side [14:00] fwereade: beyond the "global stuff is bad" thing [14:00] rogpeppe, well, it's kinda papering over unhelpful factoring of the jujud stuff [14:01] fwereade: there are lots of places where we've got several states and we change one and want another watcher to react [14:01] fwereade: well, i say "lots"... i think that may be the case. [14:02] fwereade: with the jujud stuff, i think it's ok to do black box testing, but that does mean that the command will open its own state. [14:03] rogpeppe, I would prefer it if we could see a way to get the state out of jujud, but IIRC I looked into it and it was somewhat ard to tract [14:04] rogpeppe, I do honestly favour black box testing wherever possible, I just prefer much smaller boxes :) [14:04] fwereade: the problem is that the state in jujud is a changing thing [14:04] fwereade: because it can reload === wedgwood is now known as wedgwood_away [14:05] rogpeppe, indeed so -- I do kinda think that mixing the state-opening up with the task-running is a bit of a code smell === wedgwood_away is now known as wedgwood [14:06] fwereade: well, it would be even worse if it wasn't [14:06] rogpeppe, meeting btw === wedgwood is now known as wedgwood_away === wedgwood_away is now known as wedgwood [14:32] lunch === teknico is now known as teknico_mobile === teknico_ is now known as teknico_mobile_ [15:10] fwereade: wrt py-juju parity for upgrade-charm [15:10] dimitern, oh yes [15:11] fwereade: we still need those extra flags/args first, i think [15:11] dimitern, ah, damn, --force [15:11] dimitern, that's the only one that exists in python [15:11] dimitern, IIRC [15:11] dimitern, do double-check [15:11] fwereade: which is different from --switch, right? [15:14] dimitern, yeah [15:14] dimitern, --force is just the second arg to SetCharm [15:14] fwereade: your router acting funny again? :) [15:14] dimitern, --switch is an awesome feature that it will at least be cheap and easy to add at some point in the future [15:15] dimitern, no, I go distracted by some test failures [15:15] dimitern, ==, !=, details details [15:15] fwereade: then maybe I should do --force first before starting the other 2 cards (no card for --force though) [15:16] dimitern, add a card for --force and please do no further work on upgrade-charm === teknico__ is now known as teknico [15:16] dimitern, we have parity and we have way too much else to do to go beyond at this point [15:16] fwereade: no, i meant you're dropping out quite often today :) [15:16] dimitern, ah, hadn't even noticed :) [15:16] fwereade: you mean add a card for --force, but not do it now? [15:17] dimitern, I mean do --force, because that's necessary for parity [15:17] fwereade: ok, got you [15:17] dimitern, but, with regret, don't do any of the other upgrade-charm stuff [15:18] fwereade: fine by me :) so i'll move the card for bug 1032557 in todo [15:18] <_mup_> Bug #1032557: upgrade-charm should handle relation changes < https://launchpad.net/bugs/1032557 > [15:18] dimitern, cheers [15:19] fwereade: what do you think about moving state.Endpoint into the charm package? [15:20] rogpeppe, not *quite* right, because of ServiceName [15:20] fwereade: we're pondering how api.Client.AddRelation should return details of the new relation [15:20] fwereade: and i'm suggesting it should return the endpoints [15:20] fwereade: but it can't use state.Endpoint === teknico__ is now known as teknico_mobile [15:22] fwereade: will you be off on friday? [15:22] dimitern, doubt it :) [15:22] fwereade: it could move into params, i suppose, but i don't like that [15:22] fwereade: i'm swapping it [15:22] fwereade: the other alternative is a duplicate definition [15:22] fwereade: which i'm not greatly keen on either [15:23] rogpeppe, how about everything *except* ServiceName as a charm.Endpoint, and embed a charm.Endpoint state.Endpoint? [15:23] s/state./in state./ [15:23] rogpeppe, then return... hmm... map[serviceName]charm.Endpoint? maybe? [15:23] fwereade: i was just thinking the same [15:23] * fwereade peers into cloudy crystal ball for potential problems [15:24] * fwereade can't see any obvious issues [15:25] * fwereade wanted to do this a while ago, though, so he is biased [15:25] fwereade: did gustavo have issues with the idea? [15:26] rogpeppe, (1) confusion over what "Endpoint" means (2) couldn't really see the point [15:27] rogpeppe, so (2) is covered (and as a bonus state.RelationRole will move as well, yay); re (1) give it some thought, but I don't think it's a blocker [15:28] fwereade: i *think* (1) is ok. [15:29] rogpeppe, well, it is... no worse than the current situation re "relation" [15:29] rogpeppe, in fact it maps perfectly [15:29] fwereade: yeah. i think it's a useful ancillary data structure, even if nothing else in the charm package, erm, relates to it [15:30] rogpeppe, [charm] relation, [charm] endpoint [15:30] rogpeppe, well, hmm [15:30] rogpeppe, it is actually *very* similar to a "charm relation" [15:31] rogpeppe, maybe it actually is one [15:31] fwereade: i'm just thinking that, yeah [15:31] fwereade: although... it doesn't have the name [15:31] fwereade: and Optional is a bit weird [15:31] rogpeppe, but that already exists, and doesn't have the name because it lives in a map [15:32] rogpeppe, or the role, similarly [15:32] fwereade: Relation is really a specifier for a relation, and Endpoint represents an intantiated relation [15:32] instantiated [15:33] rogpeppe, interestingly, Optional and Limit probably *should* be in state.Endpoint [15:33] fwereade: that's a good point actually [15:33] rogpeppe, how would you feel about tacking name/role onto charm.Relation, and filling the fields when parsing a Meta? [15:34] rogpeppe, I think that's the only place charm.Relations come from [15:36] fwereade: that would mean implementing Meta.UnmarshalBSON and Meta.UnmarshalJSON i guess. but that's not a bad thing, probably. [15:37] rogpeppe, I don't see a problem there but I may be myopic [15:37] fwereade: it's just more code to write :-) [15:37] rogpeppe, heh [15:38] blast, sorry, bbiab [15:41] fwereade: actually, i don't think we do need those Unmarshal methods [15:42] fwereade: as long as we don't mind a bit of redundancy in the json [15:48] rogpeppe, cool [15:49] fwereade: and i'll add (in state): type Endpoint struct {ServiceName string; charm.Relation} [15:49] there it is: upgrade-charm --force - https://codereview.appspot.com/7838054/ [15:50] rogpeppe, sgtm [15:50] dimitern, cheers [15:51] fwereade: it's almost trivial, just the wording of the help text probably needs a closer look [15:52] dimitern, yeah, that's the only thing that's exercising me ATM [15:54] fwereade: :) I didn't know of that meaning of exercising - what's worrying you there? [15:56] dimitern, trying to think of neater wording -- have some suggestions in the review [15:57] fwereade: cool, thanks [15:58] fwereade: surprisingly? probably unexpectedly is better [15:58] dimitern, as you like, I had that to begin with and then changed it :) [15:59] fwereade: well a surprise is usually associated with good things at first glance, while unexpected things are usually not good (i think) [16:00] (while both can mean the opposite i agree) [16:00] dimitern, I'm thinking of "surprising" as negative in a computery context [16:00] dimitern, law of least surprise and all that [16:00] fwereade: yeah, but you're more likely to see "unexpected error" than "surprising error" :) [16:01] dimitern, I don't feel very strongly either way, go with unexpected [16:01] fwereade: ok, thanks [16:08] fwereade: are you feeling strongly against dropping the log.warning there? I think it's beneficial for analysing what went wrong with an upgrade through the logs more easily [16:08] fwereade: s/dropping/leaving/ [16:09] rogpeppe: if you have 5m for an easy review - https://codereview.appspot.com/7838054/ [16:10] dimitern: quite busy at present trying to unblock teknico_mobile; will look in a bit [16:10] rogpeppe: sure, no rush [16:10] * rogpeppe accumulated 7 things on the paper "to do" list this morning... [16:12] dimitern, logs in the CLI are generally just dropped [16:12] fwereade: really? i was wondering why there are hardly any in the other commands [16:13] dimitern, it's because we generally don't have any sane mechanism for getting output back to the user there [16:13] dimitern, if you really wanted to, you could write something to ctx.Stderr [16:13] fwereade: hmm.. it's a pity, but ok then - will drop it [16:13] dimitern, but I think I'd need a bit more reason to actually do so [16:14] dimitern, cheers [16:14] fwereade: charm.Role rather than charm.RelationRole ? [16:18] rogpeppe, let's stick with RelationRole, it's that little bit more explicit [16:18] fwereade: ok [16:53] fwereade: changing all those Endpoint literals is a right pain... [16:53] rogpeppe, agreed [16:53] fwereade: i think it looks nicer with field names though [16:53] rogpeppe, almost certainly [16:57] dimitern, I'm starting to feel more strongly about "surprisingly" [16:58] dimitern, "unexpectedly" doesn't quite seem to cover the "lol I just changed the file you were editing" scenarios I worry about with --force [16:59] fwereade: FWIW i almost never see "surprising" in an error message context [16:59] fwereade: "unexpected" is usual, i think [17:01] rogpeppe, it's a warning in documentation, not an error message [17:01] fwereade: ah [17:01] fwereade: forgive me for jumping totally without context! [17:01] rogpeppe, no worries :) === bac_ is now known as bac [17:10] rogpeppe: exactly my point - unexpected is more common [17:11] fwereade: but if you lean more towards surprisingly, I'll change it, np [17:11] dimitern, I've come to peace with it, suggested a slight tweak in the review and LGTM [17:12] fwereade: thanks [17:14] i'll submit it once i have one more LGTM [17:15] jam, fwiw I think sync-tools is awesome, but I haven't finished the review and I'm afraid I have to go for now [17:15] fwereade: np, I think ian was going to look at it in his morning [17:15] thanks [17:20] fwereade: i'm wondering if i should go ahead with the global StartSync thing. i know it would knock 10s off the api tests for one. [17:21] rogpeppe, alternative to global StartSync [17:22] rogpeppe, testing method on Watcher that set the refresh period to 50ms? [17:22] rogpeppe, most of all I'd like to just be able to sync the actual States we care about, but I can accept that that's probably too hard [17:23] fwereade: there are various tests that fail when you do that, but i wanna fix those anyway [17:23] fwereade: that is a reasonable alternative. [17:24] rogpeppe, (the refresh period is package global, right?) [17:24] fwereade: yes [17:24] rogpeppe, just feels a touch less evil to me [17:24] fwereade: it's certainly less code [17:24] rogpeppe, that too ;) [17:25] fwereade: it's quite amusing setting the sync period to 50ms and see how many tests fail. i recommend it for a laugh. [17:25] rogpeppe, I'll save my bitter laughs for tomorrow, I think, I really must go :) [17:25] gn all [17:25] fwereade: night night [17:28] dimitern: a large CL, but mostly mechanical: https://codereview.appspot.com/8055044/ [17:35] rogpeppe: will take a look shortly [17:35] dimitern: thanks! [17:43] trivial deletion-only CL, anyone? https://codereview.appspot.com/7925045 [17:47] rogpeppe: while i'm on the first one, would you have a look at my cl? [17:48] https://codereview.appspot.com/7838054/ [17:48] dimitern: on it [17:49] rogpeppe: cheers [17:50] dimitern: LGTM [17:50] rogpeppe: awesome, i can submit it later then, tyvm [17:59] rogpeppe: you got 2 reviews [17:59] dimitern: thanks! [18:25] i'm off for the day. g'night all. [19:39] morning [20:48] fwereade_: hi [21:05] morning wallyworld [21:05] gday [21:06] how's things? [21:08] wallyworld: good [21:08] wallyworld: waiting for dave to turn up, and deciding to learn about our upgrade methods while I wait [21:09] juju upgrade? [21:09] wallyworld: as they are the only areas I need to fix for my version.Current.die.die.die branch [21:09] aye [21:09] can't wait for that branch to land [21:10] wallyworld: feel like a review? [21:11] sure, why not [21:11] https://codereview.appspot.com/7845048/ [21:13] thumper: just read the cover letter - what happens to those existing machines that are not used anymore - do they get cleaned up eventually? [21:13] not automagically afaik [21:13] but I'm not sure [21:13] maybe [21:13] it certainly requires some thought [21:13] or looking into [21:13] but I'm not sure actually [21:14] there is always destroy-machine [21:14] I think we should have a timeout somewhere [21:14] you'd like to think that juju would "Do the right thing" and not leave stuff lying around [21:14] that says if a machine is lying idle for greater than X minutes [21:14] kill it [21:14] I agree, DTRT™ is good [21:15] wallyworld: but I have a feeling that is another hunk of work [21:15] i think we are at the stage where stuff works, but there's a lot of rough edges to get rid of to productise it [21:15] * thumper nods [21:15] worth adding bug reports (good ones) [21:16] for those rough edges [21:16] as I don't think it is a huge amount of work to polish them off [21:16] still seems like a fair bit of must do stuff for 13.04 though [21:23] wallyworld: I don't think it will be polished for 13.04 [21:23] me either [21:23] wallyworld: mostly functional I think is what we are heading for [21:26] thumper: i don't fully grok the addMachine/addMachineOps logic, but the branch looks nice, and the tests are good [21:26] so i'll +1 it for what that's worth [21:26] :) [21:27] you get your name in the commit [21:27] I'll await dave :) [21:27] wallyworld: I've spent this week learning about the mongo transaction ops [21:27] yeah, best to get an informed opinion :-) [21:27] i really don't like how we write directly to mongo [21:28] and not go through a middle tier service [21:29] wallyworld: well, we are moving to that with the API [21:29] wallyworld: so, it is happening [21:29] yeah, that's good. better late than never i guess [22:15] morning davecheney [22:15] davecheney: looking for another +1 on https://codereview.appspot.com/7845048/ as wallyworld isn't entirely confident [22:16] okie dokes [22:28] thumper: still reviewing [22:28] davecheney: :) [22:28] got sidetracked by some rage [22:31] davecheney: fingers crossed, we can get this landed today [22:44] thumper: going to be one more round of changes I think [22:44] just for the turd polishing [22:45] ok [22:45] * thumper is happy to learn [22:47] there is one thing in there that will make you throw a chair [22:47] soz [22:47] oh? [22:47] why? [22:47] https://codereview.appspot.com/7845048/#msg6 [22:53] davecheney: with regard to the FitsTypeOf... [22:53] davecheney: I think it is a flawed test [22:53] davecheney: it is potentially also possible for different providers to use a different policy [22:53] davecheney: so specifying a result there is wrong [22:54] davecheney: but the method returns a particular type [22:54] thumper: the thing i saw was sometimes we use an Equals test, othertimes FitsTypeOf [22:54] davecheney: so saying "FitsTypeOf" is really just saying, does the language work [22:54] i think both are valid, but is it possible to stick to one for all the cases ? [22:54] davecheney: I think the FitsTypeOf is wrong, and happy to remove it [22:54] +1 [22:55] i was just after consistency [22:55] and with respect to the typed constants, I was just following convention [22:55] I hold no strong opinions there [22:55] but i'll take that argument as well [22:55] fair enough re typed constants [22:55] you don't need to get bogged down in that [22:55] just something to remember [22:55] worst constant ever. state.MaxUnitsPerHost ? [22:55] I don't get that comment [22:55] yeah, that current constant is terrible [22:55] JobHostUnits ? [22:55] something ? [22:56] state.MaxUnitsPerHost is my suggestion [22:56] oh, no.. this already exists [22:56] this is a job type for the machine [22:56] saying it hosts units [22:57] right, so still the worst constnt ever [22:57] anyway, I'm off to the gym now [22:57] i had no idea what it meant [22:57] roger [22:57] davecheney: I agree it is shitty, but I'm keeping it for now :) [22:58] fair enough [22:58] LGTM. submit and go to the gym === wedgwood is now known as wedgwood_away