/srv/irclogs.ubuntu.com/2012/06/12/#juju-dev.txt

=== Guest__ is now known as smaddock
rogpeppefwereade: morning guv'nor06:55
fwereadeheya rogpeppe07:15
rogpeppefwereade: looks like my upgrader proposal was premature. still, it all works; i can drag it out later :-)07:16
fwereaderogpeppe, yeah, I think it's a viable long-term direction but maybe not time for it yet07:25
fwereadepopping out for a mo, bbs09:42
Arammorning10:19
rogpeppeAram: hiya10:22
fwereadeAram, heyhey10:23
TheMueAram: Moin.10:28
fwereaderogpeppe, TheMue: I would very much appreciate your thoughts on https://codereview.appspot.com/630406811:27
fwereaderogpeppe, TheMue: everything important is in the description, the code should be a really quick skim/verify if you agree with the problem statement11:27
* rogpeppe looks11:28
rogpeppefwereade: in exchange, a few minor cleanups in the same file: https://codereview.appspot.com/6295069/11:32
fwereaderogpeppe, LGTM11:33
fwereaderogpeppe, I'd call that a trivial, just merge it11:36
rogpeppefwereade: that would certainly make our lives easier w.r.t. your branch11:37
fwereaderogpeppe, I think it'd be justified even if that weren't the case ;)11:37
fwereaderogpeppe, does the logic seem sound to you?11:37
fwereaderogpeppe, it's really just about making sure everything happens on the loop goroutine11:38
rogpeppefwereade: i think so. am still absorbing.11:38
rogpeppefwereade: small thing. i wonder if instead of having those closures all down the code, something like this might read a little better: http://paste.ubuntu.com/1037042/11:42
fwereaderogpeppe, I don't think we want to defer a Stop, which is what that effectively seems to do11:43
fwereaderogpeppe, we want to be sure that that code is called OAOO11:44
rogpeppefwereade: OAOO?11:44
fwereaderogpeppe, Once And Only Once11:44
rogpeppefwereade: i think that code is exactly equivalent to yours, no?11:44
fwereaderogpeppe, can you paste an example implementation of the Stop method?11:45
rogpeppefwereade: it's already implemented by all the sub-watchers11:45
fwereaderogpeppe, ok, then our code is definitely not doing the same thing11:46
rogpeppefwereade: really?11:46
fwereaderogpeppe, yours will wait until the tomb is dead, on the main goroutine, before the main goroutine calls tomb.Done()11:46
fwereaderogpeppe, assuming the implementations stay as they are11:47
fwereaderogpeppe, my approach ensures the cleanup code is called OAOO after the main loop has exited11:48
rogpeppefwereade: i must be missing something. AFAICS they're trivially identical.11:48
fwereaderogpeppe, the problem is in allowing any cleanup code to run on an arbitrary goroutine -- the only stuff that's safe is Kill() and Wait()11:48
fwereaderogpeppe, all the Stop implementations return tomb.Wait()11:48
rogpeppefwereade: your deferred closure does exactly the same thing as my three deferred function calls, no?11:48
fwereaderogpeppe, if they don;t do that then clients won;t be able to extract an error (unless we add a Wait method to each watcher)11:49
fwereaderogpeppe, but if they do use tomb.Wait(), then it's certainly not OK to call them on the loop goroutine, because that's the goroutine that is meant to signal that cleanup is complete in the first place11:50
rogpeppefwereade: i don't understand. i think both piece of code are trivially (potentially even by the compiler) transformable into each other.11:51
fwereaderogpeppe, stop me when I say something incorrect:11:51
fwereaderogpeppe, the Stop methods do the following: tomb.Kill(nil), stop the watcher, and wait on tomb completion before returning11:52
rogpeppefwereade: here are the steps of the transformation: http://paste.ubuntu.com/1037058/11:53
rogpeppefwereade: your code is calling Stop too11:53
fwereaderogpeppe, oh really?11:53
rogpeppefwereade: e.g. line 5111:53
fwereaderogpeppe, oh balls I totally misread it11:54
rogpeppefwereade: np11:54
fwereaderogpeppe, missed a .watcher11:54
rogpeppefwereade: thought so11:54
rogpeppemaybe stopWatcher could be stopSubwatcher11:55
fwereaderogpeppe, nah, I think it'd be clear anyway11:56
fwereaderogpeppe, still trying to figure out whether it feels like a clear improvement... I'll implement it and see how I feel ;p11:57
rogpeppefwereade: yeah, i'm not sure either.11:57
fwereaderogpeppe, my crystal ball tells me that I will use it again soon, so on that basis I think it's worth it11:58
rogpeppefwereade: it was just a reaction to seeing the same closure in all of them11:58
rogpeppefwereade: i'm already about to use it11:58
rogpeppefwereade: possible comment on stopWatcher:11:58
rogpeppe// stopWatcher stops a watcher and propagates11:58
rogpeppe// the error to the given tomb if nessary.11:58
rogpeppef11:58
fwereaderogpeppe, perfect11:59
* rogpeppe likes ad hoc interfaces11:59
fwereaderogpeppe,  how should i integrate that if you're implementing it right now?11:59
rogpeppefwereade: i'm not implementing that. i'm implementing MachineUnitsWatcher11:59
rogpeppefwereade: and i'll merge it with your changes before submitting it12:00
fwereaderogpeppe, excellent12:00
fwereaderogpeppe, cheers12:00
rogpeppefwereade: np. thanks for cleaning this up.12:00
fwereaderogpeppe, a pleasure :)12:00
TheMueJust jumped in from lunch. Together with the watchStopper/stopWatcher() both times LGTM, looks good.12:06
fwereadeTheMue, thnks12:10
rogpeppefwereade: submitted. i feel a little bit naughty.12:12
fwereaderogpeppe, I think that one is absolutely legitimate :)12:13
TheMuerogpeppe: *lol*12:17
hazmatrogpeppe, what's the support like for bzr revisions of tools?12:27
hazmatrogpeppe, does that lead major.minor.patch-revno  form?12:27
rogpeppehazmat: the plan is to use major.minor.patch12:27
rogpeppehazmat: but you get a local repo that you can push stuff to12:28
rogpeppehazmat: so you build the binaries locally and push them to the storage for a given juju environment. then it'll use them.12:29
rogpeppehazmat: does that answer your question?12:30
hazmatrogpeppe, indeed it does.. but it seems a bit manual for dev cycling on an env, it sounds like its effectively using the releases url as a namespace for priv dev via  local release repo12:31
hazmatbut that's pretty minor given the simplicity12:31
rogpeppehazmat: there's an flag to bootstrap which causes it to automatically build and upload the binaries before bootstrapping12:32
hazmatrogpeppe, upload the binaries to the env or to the release url?12:32
hazmats/env/provider storage12:32
rogpeppehazmat: to the env. there's no fixed release url - it's environment-configurable.12:33
hazmatrogpeppe, sure its configurable, but there not comparable without a release url per se12:33
hazmats/their12:33
hazmatrogpeppe, so without that flag it would default to using the release url ?12:34
rogpeppethey're? :-)12:34
rogpeppehazmat: currently there's no default. there's a "public-bucket" field in the ec2 config which would to the s3 bucket containing the public release12:35
rogpeppes/would to/would point to/12:35
rogpeppehazmat: i'd guess that when we provide one, we'll change the default to point to it12:37
hazmatrogpeppe, how are you determining the version when you upload tools on bootstrap?12:37
rogpeppehazmat: it's taken from Current in the version package.12:38
rogpeppehazmat: but the version is actually irrelevant for bootstrap because the logic will always choose a version from the private storage by preference, and the private storage starts empty.12:39
hazmatrogpeppe, ic, won't the priv storage will start populated though with the tools uploaded by bootstrap, ie has the one to be used12:41
rogpeppehazmat: destroy-environment deletes everything from the private storage, including uploaded tools.12:42
rogpeppehazmat: (if i've parsed your sentence correctly)12:43
hazmatrogpeppe, sure.. i was referencing bootstrap --tools would upload the current toolset to provider storage before the machine came up, so it would be using the only extant version there12:43
rogpeppehazmat: that's right.12:44
rogpeppehazmat: i think the flag is "--upload-tools"12:45
rogpeppehazmat: "why not support both? ie. machine monitoring global version and local version setting."12:52
rogpeppehazmat: would the local version setting be optional?12:52
niemeyerGooood morning jujuers12:52
rogpeppeniemeyer: yo!12:52
TheMueniemeyer: Moin12:56
rogpeppeniemeyer: any thoughts on https://codereview.appspot.com/6307072/ ?13:26
* niemeyer looks13:27
niemeyerrogpeppe: LGTM13:38
rogpeppeniemeyer: lovely, thanks.13:38
niemeyerrogpeppe: np, thank you13:38
hazmatrogpeppe, yes13:41
rogpeppeniemeyer: this could also use a look, while you're here: https://codereview.appspot.com/6305063/13:41
hazmatrogpeppe, you could effect a global change via one node change, a local change via one node change. no mass changes nesc.13:42
rogpeppehazmat: it means each machine agent would need to watch two things, but it would probably work ok, yeah.13:43
niemeyerrogpeppe: Done13:45
rogpeppeniemeyer: ta13:46
niemeyerrogpeppe: I'd prefer to have the set(upgrade=true) operation being extremely fast..13:48
niemeyerrogpeppe: Enough for us to not worry about updating several entries at once13:48
rogpeppeniemeyer: could be thousands if we've got that number of machines13:49
niemeyerrogpeppe: Updating thousands of values in a database is extremely fast these days13:49
rogpeppeniemeyer: each one incurs a round trip. but i'll do them concurrently, which should amleliorate that.13:50
rogpeppes/aml/am/13:50
niemeyerrogpeppe: You'r assuming an implementation :)13:51
niemeyerrogpeppe: I hope we can fix that13:51
rogpeppeniemeyer: depends on the interface in State, i think.13:51
niemeyerrogpeppe: Well, if it's so painful, let's get started with global only13:51
rogpeppeniemeyer: i don't think it's painful. i'm just wary of it...13:52
niemeyerrogpeppe: We're not making use of the fact it's per unit right now either way13:52
niemeyerrogpeppe: Ok, global only is cool for now then13:52
rogpeppeniemeyer: i think it'll be relatively easy to add local machine versions later if we decide to13:52
niemeyerrogpeppe: Okay, sounds good.. sorry for diverting your efforts13:53
rogpeppeniemeyer: np.13:53
niemeyerrogpeppe: I hope by the time we want to have it local, the backend is fast enough for us not to worry about this13:53
rogpeppeniemeyer: BTW the upgrader implementation works, and is stashed away for future reference :-)13:53
niemeyerrogpeppe: collection.update(upgrade=true) is a blast13:53
fwereadeniemeyer, are you currently reviewing convenient-relation-interface or add-unit-relation? if so, sorry: I'm about to -wip them, I think I have a better arrangement14:24
TheMueniemeyer: In https://codereview.appspot.com/6296064 I concentrated on state.go.14:24
niemeyerfwereade: I'm not.. just reviewing mails before stepping out for lunch.. there's still time14:25
niemeyerfwereade: thanks for the note14:25
fwereadeniemeyer, nah, you don't need to look at those for a bit; I should make the s/UnitRelation/RelationUnit/ change at least14:25
fwereadeniemeyer, and they may change in more interesting ways14:26
niemeyerfwereade: Does that make sense?  It felt right yesterday, but I wasn't entirely sure14:26
fwereadeniemeyer, I *think* it does, but I'm still exploring14:27
fwereadeniemeyer, if it turns out to be crack I can just repropose the original branches14:27
niemeyerfwereade: I think the convention also makes sense for that tiny type we recently introduced: ServiceRelation => RelationService14:33
niemeyerfwereade: I recall struggling with the same kind of issue thre14:33
niemeyerthere14:33
niemeyerfwereade: We did reword the docs a bit to make it clear, but didn't realize the ordering made a difference at the time14:34
fwereadeniemeyer, yeah, that is definitely on the cards14:34
niemeyerTheMue: Will have to think about this one some more..14:41
niemeyerTheMue: The repetition of logic there obviously needs some love.. still thinking about what would be the best approach14:41
TheMueniemeyer: Yes, I dislike it too and played with the idea of nesting it more. But that's also not "beautiful".14:42
TheMueniemeyer: The early return is typical for Go, but it looks strange.14:43
TheMueniemeyer: Having individual error types getting maybe a specifier, like a name, and the included error would make it look better. But logic would be the same, code would be more.14:44
niemeyerTheMue: I don't think that's an issue.. there are multiple ways to preserve that14:44
niemeyerTheMue: I'm just pondering about the best one14:44
TheMueniemeyer: We very often use value, err := ... and need the value later. This often leads to the structure.14:47
niemeyerTheMue: I understand, but the structure is fine14:48
niemeyerTheMue: We can avoid the repetition without touching it14:48
rogpeppefwereade: ping14:48
niemeyerTheMue: For example:14:48
fwereaderogpeppe, pong14:48
niemeyerdefer errorContext(&err, "can't add service %q: %v", name)14:48
rogpeppefwereade: "cannot assign subordinate units directly to machines"14:48
fwereaderogpeppe, yes14:49
rogpeppefwereade: how *do* we assign a subordinate unit to a machine?14:49
TheMueniemeyer: Hehe, thought about this too.14:49
niemeyerTheMue: >:)14:49
fwereaderogpeppe, we assign it to a unit, surely?14:49
rogpeppefwereade: using AssignToMachine?14:49
fwereaderogpeppe, no, certainly not14:50
rogpeppefwereade: so... how then?14:50
fwereaderogpeppe, we AddUnitSubordinateTo()14:50
niemeyerrogpeppe: Subordinate units must necessarily be in the same machine of their principal14:50
fwereaderogpeppe, I'm not sure where the responsibility lies in python for handling that though14:51
rogpeppefwereade: ah, so subordinate units don't have a Machine set in their topology node?14:51
TheMueniemeyer: And err is a named return value. In case it's nil when the message returns errorContext() will let it stay nil, otherwise it will "pimp" the error.14:51
niemeyerTheMue: Yep14:51
rogpeppefwereade: that means my just-submitted Machine.Units implementation is wrong14:51
TheMueniemeyer: OK, will add it.14:52
fwereaderogpeppe, sorry, not sure I saw that one; how so?14:52
niemeyerrogpeppe: Ah, curious14:52
niemeyerrogpeppe, fwereade: Worth looking at both ends in that regard.. I certainly didn't pay attention to that myself14:52
rogpeppefwereade: you LGTM'd it...14:53
rogpeppefwereade: it's wrong because it doesn't return subordinate units14:53
rogpeppefwereade: i assumed that all units on a machine had Machine=that-machine14:53
rogpeppefwereade: but if that's not true for subordinates, i'll have to do some more delving14:54
rogpeppefwereade: i *think* that it would be good if the unit machine was set in the topology regardless of whether it's subordinate or not.14:54
fwereaderogpeppe, no doubt it will click the second I see it, but I can't parse its location out of my emails... CL please?14:55
rogpeppefwereade: https://codereview.appspot.com/630707214:55
fwereaderogpeppe, there is probably a case to be made for that though14:55
* fwereade reads and thinks14:55
rogpeppefwereade: that would mean, i think, that AddUnitSubordinateTo would automatically assign the subordinate unit to the principal's machine if there is one, and that AssignToMachine would also assign any subordinate units to that machine.14:56
niemeyerrogpeppe: I find that sensible too14:56
niemeyerrogpeppe: Although.. hmm14:57
niemeyerYeah, no, that sounds good indeed14:57
rogpeppeniemeyer: ok, sounds like a plan.14:58
fwereaderogpeppe, niemeyer: the difficulty is kinda in thinking of Units as meaning Containers14:58
niemeyerWe have evidence of algorithms being written incorrectly based on lack of a sound assumption14:58
niemeyerfwereade: Yeah, but they're not really14:58
fwereadeniemeyer, indeed so14:58
niemeyerfwereade: The fact we're having to think this way is a hint rogpeppe is right14:58
fwereadeniemeyer, agree Units should actually be all units, not all principal units14:58
rogpeppefwereade: +114:58
fwereaderogpeppe, nice catch, ty14:59
rogpeppefwereade: ok, i'll submit that as a fix first, before submitting machine-units-watcher14:59
rogpeppefwereade: it was your catch - you wrote the error message that stopped my test running!15:00
fwereaderogpeppe, ah, I missed that detail15:00
* fwereade feels smug15:00
rogpeppe "cannot assign subordinate units directly to machines"15:00
rogpeppe... and rightly so :-)15:00
niemeyerI'll head to lunch.. may take a bit more time today as it's Valentines here so we'll go to a proper place to have lunch. Back soon for more fun.15:28
rogpeppeniemeyer: have a good one!15:35
rogpeppefwereade: i think that topology.AddUnit should fail if the principal unit no longer exists. does that sound right to you?15:36
fwereaderogpeppe, yeah, that sounds correct15:36
rogpeppefwereade: ok, i'll fix that15:36
rogpeppefwereade: thanks15:37
fwereadeanyone:15:38
fwereadeRietveld: https://codereview.appspot.com/630008515:38
fwereadeerror: Failed to run "bzr merge": exit status 315:38
fwereade-----15:38
fwereadebzr: ERROR: Cannot lock LockDir(chroot-80383440:///%2Bbranch/juju-core/.bzr/branch/lock): Transport operation not possible: readonly transport15:38
fwereade-----15:38
fwereade?15:38
rogpeppefwereade: does it happen repeatedly?15:38
fwereaderogpeppe, yeah15:38
rogpeppefwereade:  running lbox submit?15:39
fwereaderogpeppe, indeed so15:39
rogpeppefwereade: what does the output of lbox submit -v look like? (i'm wondering if it's something to do with lp:juju-core vs lp:juju-core/juju)15:40
fwereaderogpeppe, http://paste.ubuntu.com/1037422/ seems to be the relevant bit15:43
rogpeppefwereade: hmm, odd. let's see the whole thing. i doubt i can help though, i'm afraid.15:45
fwereaderogpeppe, http://paste.ubuntu.com/1037428/15:46
fwereaderogpeppe, but wait, yes, I see a bare lp:juju/core in there15:46
fwereaderogpeppe, lp:juju-core15:47
rogpeppefwereade: that might be your problem. you might want to delete the merge proposal and try again, with an explict --for lp:juju-core/juju15:47
fwereaderogpeppe, sounds good, thanks15:47
rogpeppefwereade: if in doubt, reinstall Windows.15:48
fwereaderogpeppe, looks like I'll be reinstalling windows :/15:52
rogpeppefwereade: that didn't help then15:52
fwereaderogpeppe, I'll try with a new branch from juju-core/juju and merge the original branch into that, see if it helps15:53
twobottuxaujuju: Is juju specific to ubuntu OS on EC2 <http://askubuntu.com/questions/149952/is-juju-specific-to-ubuntu-os-on-ec2>15:53
fwereaderogpeppe, bah, doesn't even work when I do that16:00
rogpeppe fwereade: darn. i'd start googling for "bzr readonly transport" and maybe have a delve into the source.16:02
rogpeppefwereade: ... and thereby waste the rest of the day16:02
fwereaderogpeppe, yeah, I'm going to do the stuff that's currently right on my mind and figure that out a bit later16:02
rogpeppefwereade: yeah, and niemeyer may be back by then16:03
TheMuerogpeppe: I understand your concerns that just adding a prefix string with a "nice description" of the method name doesn't add much new context informations.17:07
TheMuerogpeppe: But having a chain of those calls may the error string contain more and more information (a kind of error stack).17:08
rogpeppeTheMue: that's going to happen either way, AFAICS.17:08
TheMuerogpeppe: It's only bad analyzable.17:09
rogpeppeTheMue: i can't parse that17:09
TheMuerogpeppe: So a kind of struct {msg, err} would maybe help more.17:09
rogpeppeTheMue: what i'm saying is orthogonal to analysability17:10
rogpeppeTheMue, fwereade: subordinate units machine assignment. https://codereview.appspot.com/629907317:10
rogpeppeniemeyer: ^17:11
TheMuerogpeppe: How would your solution look like?17:12
niemeyerYo17:12
rogpeppeTheMue: my message described the error messages i'd use in that function17:12
rogpeppeniemeyer: yi17:13
niemeyerrogpeppe: You have question from bcsaller there17:15
rogpeppeniemeyer: yeah, i'm just looking at it17:15
rogpeppeniemeyer: i *think* we'd decided that the MA *was* responsible for all unit deployments.17:16
niemeyerrogpeppe: That's not what we agreed to, no17:16
rogpeppeniemeyer: ok, i must've misunderstood17:16
bcsallerrogpeppe: thats hard to pull off anyway, supose the container is LXC, you don't have easy access to its internals from the MA, only from the UA inside that container17:17
rogpeppebcsaller: very true. hmm.17:17
bcsallerthere are ways around that, but its tricky and I didn't think it was worth it17:18
bcsallerrogpeppe: that said understanding the timing issue where the subs are added to late for that call to matter is also important17:19
TheMueniemeyer: The defer/error interface message sadly doesn't work, you can't set a new err in that method.17:20
rogpeppebcsaller: i'm not quite sure what you mean by "too late for that call to matter". matter to what?17:20
bcsallerto make any change17:20
bcsallerthe principal is deployed and assigned, then a day later they add a monitoring subordinate17:21
TheMueniemeyer: I've got a somewhat scruffy idea using an own helper error type.17:21
bcsallerif I read it properly the principal was suppose to tag its sub17:21
bcsallerwith the machine id, but that won't happen17:21
bcsallerrogpeppe: ^17:22
TheMueniemeyer: But it's indeed not beautiful.17:22
Aramdid the email I sent to juju-dev went through?17:22
rogpeppebcsaller: i don't see why not. if the principal is assigned, the subsid will be assigned when it's added17:22
rogpeppebcsaller: but there is a bigger issue here. perhaps Machine.Units should not return subsidiary units, as the MA doesn't care about them.17:23
rogpeppebcsaller: in which case all that branch is crack17:23
bcsallerrogpeppe: agreed, it should not, its not the thing managing them17:24
niemeyerTheMue: Yes, you actually can set an error in that method17:31
niemeyers/method/function/17:31
rogpeppeAram: i haven't seen anything17:31
rogpeppeAram: if you're referring to a message you've sent just recently17:32
rogpeppe[18:16:16] <rogpeppe> niemeyer: i *think* we'd decided that the MA *was* responsible for all unit deployments.17:32
Aramrogpeppe: yes, I got a moderator approval needed bounce.17:32
rogpeppeoh yeah, we'd actually agreed the precise opposites17:32
rogpeppeopposite17:32
rogpeppeniemeyer: so it looks like that branch is rubbish - Machine.Units shouldn't return subsidiary units; do you agree? then we can have a Unit.WatchSubsidiaries method later that the unit agent can use, perhaps.17:34
rogpeppeAram: did you send it from your canonical.com address?17:34
Aramyes, but I used my alias instead of my real email, gah, resending.17:35
TheMueniemeyer: err can be set, then it's passed as reference to the deferred errorContext(). There err (which is *error) can be set, but when returning the old err is still valid. If err would be e.g. a structure I could modify a field, yes, or a slice value or map.17:35
Aramrogpeppe: this time it worked17:36
TheMueniemeyer: Deferring a func() {} and modify err in there through errorContext() with a return value should help. Wouldn't be so elegant. But less repeating than today.17:37
niemeyerTheMue: Sorry, I'm missing what you mean17:37
niemeyerTheMue: The exact signature I suggested should work, without any further hacks17:38
niemeyerTheMue: Why is it not working?17:38
niemeyerrogpeppe: Subordinates17:39
niemeyerrogpeppe: Why is it rubbish?17:39
rogpeppeniemeyer: because there's no need for the machine agent to see subordinate units. and that's what Machine.Units and Machine.UnitsWatcher is for.17:40
TheMueniemeyer: You pass an interface X by reference. You could call the interfaces methods or if it would be a struct you could modify the fields. But if you set the argument the scope is only inside the function.17:40
TheMueniemeyer: errorContext(err *error) { err = fmt.Errorf("foo") } runs (ok, you need a temp variable to create a reference), but after the call of errorContext(&e) that e stays the same.17:42
rogpeppeniemeyer: i've got to go, i'm afraid. i'll leave the branch out for review, but i'm pretty sure now that it's a wrong direction.17:43
niemeyerTheMue: Your implementation seems to be bogus somehow17:45
niemeyerTheMue: Can you please replicate your idea here: http://play.golang.org/17:45
TheMueniemeyer: A defer func() { err = errorContext(err, "Foo %q", id) } would help.17:45
TheMueniemeyer: For sure.17:45
niemeyerTheMue: Thanks17:45
niemeyerrogpeppe: There is a method in the unit.. IsSubordinate()17:45
niemeyerOr IsPrincipal17:45
rogpeppeniemeyer: that re-reads the topology each time, and it's unnecessary.17:46
rogpeppeniemeyer: the thing watching a machine is never going to want to see subordinates17:46
rogpeppeAFAICS17:46
TheMueniemeyer: http://play.golang.org/p/s5yfet7UL217:49
niemeyerrogpeppe: We can cache that information17:49
niemeyerrogpeppe: A unit is either subordinate or not, for its whole life17:50
rogpeppeniemeyer: we could call the methods Machine.PrincipalUnits and Machine.PrincipalUnitsWatcher if we wanted to be clearer17:50
niemeyerrogpeppe: Well, we can also rename the methods17:50
niemeyerrogpeppe: To suit what we need17:50
TheMueniemeyer: Alternative follows.17:50
rogpeppeniemeyer: jinx17:50
niemeyerrogpeppe: Yeah17:50
niemeyerrogpeppe: I'll review the code and provide you some feedback so that we can either move forward or have some better conversation tomorrow17:51
niemeyerrogpeppe: Btw, we have to sort out the branch location too17:51
niemeyerrogpeppe: I'm fine with renaming it after we get some of those branches in, if we feel like so17:51
rogpeppeniemeyer: what's wrong with the branch location?17:51
niemeyerrogpeppe: The stuff we talked in the ML17:52
rogpeppeniemeyer: ah yeah. i definitely think it should be juju-core/trunk.17:52
TheMueniemeyer: http://play.golang.org/p/aFA7LtLhoR works.17:52
niemeyerrogpeppe: Okay, I think juju-core/stuff would be nice too..17:52
rogpeppeniemeyer: -117:52
niemeyerHm?17:53
rogpeppeniemeyer: "stuff" implies random shit17:53
niemeyerrogpeppe: stuff as in {environs,juju,testing,cmd,...}17:53
rogpeppeniemeyer: definitely!17:53
niemeyer:)17:54
rogpeppeniemeyer: i'd expect it to be just the same as goamz etc17:54
rogpeppeniemeyer: i was surprised when it wasn't17:54
Aramme too17:54
Aramthat juju seemed redundant17:55
niemeyerTheMue: http://play.golang.org/p/aFA7LtLhoR17:55
rogpeppeanyway, really gotta go now! happy evening/day all.17:55
niemeyerrogpeppe: Thanks for the day, and have a great evening17:55
Aramenjoy17:55
TheMueniemeyer: Yes, that's my second solution.17:56
niemeyerTheMue: Sorry, I fail17:56
niemeyerTheMue: http://play.golang.org/p/yg1N6xnJyo17:56
TheMueniemeyer: Ah, nice, the dereferencing of the argument has been new to me. Thx, great info.17:58
niemeyerTheMue: Yeah, pointers..17:59
niemeyerTheMue: Java "saves" you from that side of things17:59
Aramyeah, everything is a pointer.18:00
niemeyer(because *everything* is a pointer!)18:00
niemeyerAram: Jinx :)18:00
TheMueniemeyer: Never have used them much. Not only Java, but also Erlang or Smalltalk.18:00
niemeyerTheMue: Erlang is a veeeery different beast :)18:00
TheMueniemeyer: Erlang indeeeeeeeeeeeeeeeed. But I like it, yeah.18:01
TheMueniemeyer: And Smalltalk also passes everything by reference.18:01
niemeyerTheMue: Passing by reference has a different meaning than what you imply, I suspect18:01
TheMueniemeyer: It's different, yes.18:02
AramALGOL passes variables not by value or reference, but by name, sort of like a macro.18:02
niemeyerTheMue: C++ has by-reference semantics, and it sucks18:02
TheMueniemeyer: Only done C++ a bit in the late 80s.18:03
niemeyerAram: Oh, never read about that18:03
TheMueniemeyer: But it hasn't been my language. During this time I more used the good old Turbo Pascal. ;)18:04
Aramlong time ago I introduced a Pascal friend to C, and he loved it because it wasn't really type safe like Pascal.18:05
Aramyou could do lots of stupid tricks.18:05
TheMueAram: I loved Smalltalk, but it's sadly going deeper and deeper into history. And the implementations missing good concurrent VMs. There's only one experimental by IBM.18:07
TheMueSo, have to leave for today.18:31
TheMueniemeyer: First changed methods look and feel good.18:31
niemeyerTheMue: Sweet!18:31
TheMueniemeyer: ;)18:31
niemeyerbcsaller: ping20:05
bcsallerniemeyer: whats up?20:16
niemeyerbcsaller: Heya20:16
niemeyerbcsaller: I was just looking at that branch from rog20:16
niemeyerbcsaller: Have you found an edge case where it would leave data in an inconsistent state?20:17
niemeyerHmm20:17
bcsallerniemeyer: thats not what I was pointing out, it was just that the method seemed to be triggered before subordinates were bound to the principal unless I read it wrong20:18
niemeyerbcsaller: Is there a way to create a subordinate unit without binding it to a principal?20:18
niemeyerbcsaller: (unit, not service)20:19
bcsallerthe service yes, instances only appear when the relation is satisfied, you can deploy the sub w/o a realation and only ZK is changed20:19
bcsallerniemeyer: no, sub units always have a principal, but can be added well after the establishment of the principal20:19
niemeyerbcsaller: Right, but his code path also covers that20:20
niemeyerbcsaller: In the sense that he's checking to see if the principal is assigned by the time the subordinate is added20:20
niemeyerbcsaller: Do you see another angle open?20:21
bcsallerthe other thing I mentioned is that machine assigment is the watch trigger to deploying a UA.20:21
niemeyerCool20:22
niemeyerbcsaller: There's a race there too I suppose20:22
bcsallerniemeyer: in the python version we proxy the machine id lookup to the principal for the subs and don't do the assignment20:23
bcsallerniemeyer: that might not be the best way, but its a possible path forward20:23
niemeyerif the unit is assigned to a machine while concurrently a subordinate unit is added to the principal, the subordinate will be added without a machine, and the principal will not notice the existence of the unit20:23
niemeyerWell, or maybe not if it's properly done within a retryChange transaction20:23
niemeyerbcsaller: It feels less fiddly for sure20:24
bcsallerniemeyer: in this case the principal is processing its relation change events and deciding if it needs to take action (deploy a subordinate)20:24
bcsallerbut the MA isn't involved20:24
bcsallerwhich in the LXC everywhere future I think is important20:25
=== davechen1y is now known as davecheney
andrewsmedinawhy the zookeeper will be replaced?23:04
davecheneyandrewsmedina: for a number of reasons, one being it won't run on arm23:05
andrewsmedinadavecheney: hmm23:09
andrewsmedinajuju will run on arm?23:11
davecheneyi hope so, arm is a supported ubuntu server platform23:12
hazmatSpamapS, +1  rest apis and soa23:21
hazmatits in the plans23:21
hazmati believe23:21
SpamapSgood :)23:27
andrewsmedinaSpamapS == Clint Byrum ?23:33
SpamapSandrewsmedina: indeed :)23:34
andrewsmedinaSpamapS: :)23:35

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!