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

davecheney[ANN] juju-core 1.9.3 has been released00:48
davecheneyhttps://lists.ubuntu.com/archives/juju-dev/2012-December/000333.html00:48
wallyworld_davecheney: g'day, i have a problem you might me able to help me solve if you have a moment to take a look.04:56
davecheneywallyworld_: shoot05:09
wallyworld_davecheney: see https://codereview.appspot.com/6874049/patch/1/7, the TODO about 2/3 of the way down // TODO: WHY DOESN't THIS WORK?05:10
wallyworld_you may not have an idea of what's wrong. i can't see it right now05:10
wallyworld_the array ends up filled with the last id05:10
wallyworld_so if there are 2 servers, the array becomes [id2, id2] instead of [id1, id1]05:11
wallyworld_[id1, id2] i mean05:11
davecheneywallyworld_: yes, this is one of two gotchas with go05:11
wallyworld_only 2?05:11
davecheney(the other is also to do with scoping of variables05:11
davecheney(well, two that I consider gotchas)05:12
wallyworld_so what am i missing?05:12
wallyworld_i use append elsewhere in similar circumstances and it seems to work05:13
davecheneyif you do s := server ; insts = append( ...)05:13
davecheneyit will work05:13
wallyworld_wtf? why?05:14
davecheneyhold on, i'll explain05:14
davecheneyjust looking at why you're doing := range *servers05:14
wallyworld_ok05:14
wallyworld_the api returns a pointer to an array of structs05:15
wallyworld_due to that big discussion i had on irc last week05:15
wallyworld_about  returning nil if the json failed05:15
davecheneyok, i don't want to get into that05:15
wallyworld_me either :-)05:15
wallyworld_just providing context05:15
wallyworld_as to why it is a pointer05:16
davecheneyif we break down the for loop, what is happening behind hte scenes you're getting05:16
davecheneyvar server Nova.server05:16
davecheneyfor i := 0 ; i < len(*servers); i++ {05:16
davecheney    server = *servers[j]05:16
davecheney ... then your code05:16
davecheney}05:16
davecheney(this is part of the explanation)05:17
wallyworld_*servers[i]?05:17
davecheneydo you agree that this can be subtituted for the range above05:17
wallyworld_yes05:17
wallyworld_with the i05:17
davecheneyyes, sorry05:17
wallyworld_np, just making sure05:17
davecheneyso inside each loop iteration it becomes05:17
davecheneyserver = *servers[i] (hidden)05:18
davecheneyinsts = append(insts, &instance{e, &server})05:18
davecheney&server is capturing the address of the local server variable every time05:19
davecheneythe same local server variable05:19
davecheneywhich is why they all end up as the last value assigned to it05:19
* wallyworld_ thinks05:20
wallyworld_davecheney: so by doing s:= server, it forces a copy to be made?05:21
davecheneyyes05:21
wallyworld_ok, i think i get it. is the moral of the story not to use loop variables in certain circumstances?05:22
davecheneywhen taking their address05:22
davecheneysadly this is just one thing you have to be ever vigilant for05:22
wallyworld_right, ok. thanks so much. i wasted a loooong time on this05:23
davecheneysorry, it is one of the rights of passage05:23
wallyworld_lol05:23
wallyworld_i still don't feel like Go is "native" just yet, but it's getting there05:24
davecheneythat's good to hear05:24
davecheneyi'm constantly amazed at how quickly can pick up the language05:24
davecheneyit tells me it's doing something right05:24
wallyworld_yeah, there's some stuff i don't like, but it's interesting to work with05:25
davecheneywallyworld_: btw, do you feel that any sort of decision was reached about the 'when and how should we meet' discussion ?05:25
davecheneyin the meeting I got the impression, and looking at the notes, that the decision to not change anything was made05:25
wallyworld_my understanding was alternating times 21:00UTC and 09:00UTC05:25
davecheneythen the day after Mark posted an email saying we're going to do that05:25
davecheneyalternating times ?!05:26
davecheneyi read that as two meetings05:26
wallyworld_it was explained to me as alternating and you would make whichever meeting you could05:26
wallyworld_or both05:26
davecheneybut, alternating every other week ?05:26
wallyworld_yes05:26
wallyworld_unless i am mistaken05:27
davecheneyso we can go an entire milestone cycle without meeting or feedback ?05:27
wallyworld_is each milestone cycle 2 weeks?05:27
wallyworld_i think for you and me we can make both05:27
davecheneyyou can see we run a pretty loose ship on juju-core, but yes, ish05:27
wallyworld_to be honest, the current one that is 10pm for me i can make most weeks05:28
davecheneyit's 11pm for me05:28
wallyworld_yeah, DST :-)05:28
davecheneyand i'm getting pressure from home05:28
wallyworld_which i guess is why they changed it05:28
wallyworld_timezones suck sometimes05:29
wallyworld_happy wife, happy life05:29
wallyworld_i'm not sure if tomorrow's meeting is still at 0pm, will have to check05:29
davecheneyDST is bitch if you need to coordinate with western europe05:33
davecheney7pm UK time is 6am AEST05:33
davecheney(or is that AEDT05:33
wallyworld_i thought it was 7am AEST05:34
davecheneynup05:35
davecheneyhttp://everytimezone.com/05:35
wallyworld_not 7pm, 9pm05:35
wallyworld_21:00UTC05:35
wallyworld_so +10 is 7am for me05:35
TheMueMorning06:50
davecheneymorning06:51
TheMuedavecheney: Had a nice weekend?06:51
=== TheMue_ is now known as TheMue
rogpeppe2morning all08:34
=== rogpeppe2 is now known as rogpeppe
TheMueHiya rogpeppe08:40
fwereaderogpeppe, TheMue, heyhey08:45
fwereaderogpeppe, TheMue: I would appreciate your opinions on the Living interface08:45
TheMuefwereade: Hi08:45
rogpeppefwereade: just jotting down some thoughts i had over the weekend. will have a look in a bit, thanks for the heads up.08:46
fwereaderogpeppe, TheMue: it only seems to be used for the tests08:46
fwereaderogpeppe, TheMue: and I have slight concern that it doesn't really fit our needs08:46
rogpeppe fwereade: what CL are we talking about?08:46
fwereaderogpeppe, it's a piece that's already in place08:47
rogpeppefwereade: ah08:47
fwereaderogpeppe, state/life.go08:47
fwereaderogpeppe, it has EnsureDying/EnsureDead08:47
rogpeppefwereade: you're objecting to those methods?08:47
fwereaderogpeppe, we took those methods off Relation because they didn't make sense08:47
TheMuefwereade: If you say you have concerns that it fits our needs, then please start by definig what you think our needs are.08:48
fwereaderogpeppe, and while they're ok for unit they don't express enough08:48
rogpeppefwereade: do you think Unit needs a richer interface than a simple "EnsureDead"?08:48
rogpeppefwereade: or EnsureDying08:49
fwereaderogpeppe, yeah -- remove-unit --force08:49
fwereaderogpeppe, we need a way to say, politely, "please kill yourself"; a way to say politely "I'm done, clean me up"; and a way to force dead immediately08:49
rogpeppefwereade: ah, so EnsureDying isn't allowed to take account of things that might block the EnsureDying08:50
fwereaderogpeppe, yeah, nothing should block an EnsureDying08:50
rogpeppefwereade: emr08:50
fwereaderogpeppe, depending on the circumstances, the existence of subordinates may or may not want to block EnsureDead08:50
rogpeppeerm08:50
rogpeppefwereade: istm that EnsureDying *is* a way to say, politely, "please kill yourself"08:51
rogpeppefwereade: and that EnsureDead *is* a way to force dead immediately08:51
TheMuerogpeppe: That's how I understood it too.08:51
fwereaderogpeppe, yes... we have 3 things to express, and 2 0-arg methods08:51
rogpeppefwereade: that doesn't sound like the current interface is wrong, but that some things may need more08:52
fwereaderogpeppe, maybe08:53
TheMuefwereade: Please match the current methods to your three sentences above to make sure which one you don't see covered.08:53
fwereaderogpeppe, bear in mind that it was already dropped from relation because it's useless08:53
rogpeppefwereade: how do you remove a relation then?08:54
fwereaderogpeppe, TheMue: EnsureDying=please kill yourself, EnsureDead=die immediately; no way to politely signal your own death08:54
fwereaderogpeppe, it depends08:54
fwereaderogpeppe, I ca dredge up the details if you like08:54
rogpeppefwereade: by "signal your own death", do you mean there's no way to tell others when you've died?08:55
fwereaderogpeppe, there is no convenient way for me to coordinate the unit's death amongst various tasks08:55
TheMuefwereade: So you want a kind of destructor. But that is something the entitiy has to signal. It isn't signalled from the outside to the entitiy.08:55
rogpeppefwereade: i'm not sure what you mean by that08:55
fwereaderogpeppe, ok, maybe I should shift perspective around and see what sorts of statements we agree on08:57
fwereaderogpeppe, the only thing that can sanely set a machine to Dead is a machine agent; agreed?08:57
fwereaderogpeppe, and the only thing that can sanely set it to Dying is the user08:57
TheMuefwereade: How would you name that third method? And who will call it?08:58
rogpeppefwereade: i'm not sure. what if the machine has gone away and isn't coming back?08:58
fwereaderogpeppe, do you mean the "instance"08:58
rogpeppefwereade: yeah08:58
fwereaderogpeppe, I don't think that's relevant then?08:58
fwereaderogpeppe, juju will provision a new one and put the machine agent on it08:58
rogpeppefwereade: do we have to resurrect the instance and its machine agent in order to kill the Machine?08:59
* TheMue still thinks it's a wrong perspective. The first two methods are telling the entity that it has something to to, the missing one is used by the entity itself to signal the outer world that a state is reached and the outer world has something to do.09:00
TheMues/to to/to do/09:00
fwereaderogpeppe, you're talking like we can *stop* juju from provisioning a new instance for a broken machine?09:00
fwereadeTheMue, ok09:01
fwereadeTheMue, what does service.EnsureDead do?09:01
fwereadeTheMue, btw you are wrong re methods: if an entity is dead, it must *not* do anything, and in the normal case of affairs it doesn't even see itself become dead because it sets and terminates itself09:02
TheMuefwereade: It sets the entity to dead.09:02
fwereadeTheMue, the notion of EnsureDead from outside the entity is only sane in the case of units, and that's only because we carved out an exception for remove-unit--force09:03
fwereadeTheMue, ok, and what happens when you do that?09:03
fwereadeTheMue, and more to the point, when is it ok to do that?09:04
rogpeppefwereade: what if an instance goes down and the user calls terminate-machine before it's been reprovisioned?09:04
TheMuefwereade: I would have to take a look what's done today. But IMHO after an entity is marked as dead it can be cleaned up.09:05
fwereaderogpeppe, if we can detect that for sure, then we can remove it; no reason to make it dead09:05
fwereadeTheMue, think through what will happen if we set a service to Dead09:05
fwereadeTheMue, what should happen to the units of that service?09:05
TheMuefwereade: I'm currently looking from a more abstracte perspective about where methods have to apply.09:05
rogpeppefwereade: doesn't it have to be dead before we remove it?09:05
fwereaderogpeppe, not at all, we don't do that with relations09:06
TheMuefwereade: IMHO they should be set to dead too, before the service is marked as dead.09:06
fwereaderogpeppe, I'm not sure the Dead state is even meaningful for relations or services09:06
fwereadeTheMue, how will you craft your request to set 100k units to Dead?09:06
TheMuefwereade: I have no quick answer. But logically, if a service shall be set to dead, shouldn't the units be dead too?09:08
fwereadeTheMue, using the txn package, remember09:08
fwereadeTheMue, logically, yes09:08
fwereadeTheMue, but there are 2 possibilities here09:08
fwereadeTheMue, we can set services to dead, and get crack, or wee can admit that service.EnsureDead is (probably) crack09:08
rogpeppefwereade: anyway, sorry that was a derail. say, for the sake of argument, we accept that only a machine agent can set its machine to dead. what then?09:08
rogpeppefwereade: are you saying that if we set something to dead, we may as well just remove it?09:09
fwereaderogpeppe, ok, so machines are easy: Dying from outside, Dead from inside09:09
TheMuerogpeppe: Do we mix topics here?09:09
fwereaderogpeppe, not at all -- I'm saying that relations and services have no use for a Dead state, because we can just remove when appropriate09:10
fwereaderogpeppe, units and machines *do* have a use for the dead state09:10
* TheMue would like to stay on the path what should happen to units, independent of their number, when their service is said that it shall die.09:11
fwereaderogpeppe, but the agreement thus far has been that the only one we should be setting to dead from outside was unit, and that in a not-especially-high-priority feature09:11
fwereadeTheMue, what we do is set the service to Dying09:11
fwereadeTheMue, every unit is the responsible for setting itself to dying and cleaning itself up09:11
fwereadeTheMue, the units' deployer waits for it to become dead09:12
TheMuefwereade: Is every unit watching it's services' lifecycle?09:12
fwereadeTheMue, yes09:12
TheMuefwereade: Ah, ok, missed that, thanks.09:12
rogpeppefwereade: it sounds like you're arguing for removing EnsureDead09:13
fwereadesorry 1 sec09:13
fwereaderogpeppe, I'm not stronly arguing *for* anything, I'm just trying to raise the topic for discussion in the hope something will be synthesized therefrom09:13
fwereadeTheMue, to continue: then the deployer removes the unit09:13
TheMuefwereade: And markes it as dead?09:14
fwereadeTheMue, the unit marked itself as dead09:14
fwereadeTheMue, the deployer is then responsible for uninstalling it and removing it from state09:14
TheMuefwereade: How does it mark itself as dead?09:14
fwereadeTheMue, and removing its service from state if it was the last member of a dying unit09:14
fwereadeTheMue, at the moment it calls EnsureDead09:15
TheMuefwereade: The unit calls EnsureDead() on itself? Aha.09:15
fwereadeTheMue, but this will not work correctly in the presence of subordinates09:15
fwereadeTheMue, yes09:15
fwereadeTheMue, in general only an entity is meant to declare itself dead09:15
TheMuefwereade: Could you give me a hint where in the code this happens?09:16
fwereadeTheMue, the EnsureDead? worker/uniter/modes.go09:16
fwereadeTheMue, ModeStop or something? ModeDie?09:16
TheMuefwereade: So the uniter calls it, not the unit.09:16
fwereadeTheMue, what part of the unit has its own volition if not the uniter?09:16
rogpeppeback in a mo09:16
TheMuefwereade: It's only the wording I want to get sure. If I talk about Unit it's state.Unit. Not about the uniter.09:17
fwereadeTheMue, sure, sorry, I didn't mean to be unclear09:18
TheMuefwereade: I only wanted to clear that to not be confused.09:18
TheMuefwereade: I never been deep in the uniter. So that's important to me to get a similar context.09:18
fwereadeTheMue, I think of a Unit as a dumb type manipulated by interesting clients -- the clients are the agents and the command line09:18
rogpeppeback09:19
TheMuefwereade: OK, now it's more clear, thanks.09:19
fwereaderogpeppe, actually, how do you expect we will set a machine to dead? thinking about it, that sounds like a job for the machiner09:20
fwereaderogpeppe, and it sounds like exactly the same problem as the uniter has09:20
rogpeppefwereade: is the provisioner right to allocate a new instance for a machine that's set to dying?09:20
fwereaderogpeppe, if it's still meant to be running a unit, yes, unless you have a better idea09:21
fwereaderogpeppe, but I forget: did we agree that we couldn't set a machine to dying until it had no assigned units?09:21
rogpeppefwereade: i thought we could always set something to *dying*09:22
fwereaderogpeppe, I haven't thought so much about machine lifecycles, which is probably why I perceive them as a simple problem.. I bet they aren't really ;p09:22
rogpeppefwereade: i have a suspicion we have some muddy thinking about the machine/instance/unit relationship09:23
fwereaderogpeppe, ok, so terminate-machine shouldn't actually terminate the machine?09:23
fwereaderogpeppe, ok, please explain your view of the situation09:24
fwereaderogpeppe, is it your position that terminate-machine should also terminate all the units on that machine?09:24
rogpeppefwereade: i don't have a strong notion of *how* our thinking is muddy, just that i don't clearly understand things, and i'm not sure anyone else does09:24
fwereaderogpeppe, beacuse it has hitherto meant "I will never use this unused machine again", and been blocked by the machine's having units deployed09:24
rogpeppefwereade: ok, well that sounds reasonable09:25
fwereaderogpeppe, ok, you know what? this makes me question EnsureDying/EnsureDead still more09:25
rogpeppefwereade: so... say a machine is unused but its instance has just died; someone calls terminate-machine before the provisioner has noticed that the instance is dead.09:26
rogpeppefwereade: when the provisioner notices that the instance is dead, should it allocate another one?09:26
rogpeppefwereade: i don't see any question about EnsureDying09:27
rogpeppefwereade: EnsureDead seems to be the problematic part of the interface09:28
fwereaderogpeppe, ok, what does it do?09:29
fwereaderogpeppe, please describe the chain of consequences from EnsureDying09:29
rogpeppefwereade: the provisioner can see when an instance dies, right?09:30
fwereaderogpeppe, yeah, I think so, roughly09:31
rogpeppefwereade: (i'm not actually sure that it can, tbh, but this we seem to believe it)09:31
rogpeppes/this we/we/09:31
fwereaderogpeppe, I think it s possible to infer it anyway09:31
rogpeppefwereade: i'm not sure it is09:31
rogpeppefwereade: in the presence of network failures09:31
rogpeppefwereade: anyway, assuming we can09:32
rogpeppefwereade: when the provisioner sees an instance go down, it allocates a new one and assigns the old Machine to it, right?09:32
fwereaderogpeppe, yeah09:32
rogpeppefwereade: so if someone has called EnsureDying on that machine, should the provisioner really allocate a new instance for the machine?09:33
rogpeppefwereade: (surely not?!)09:33
fwereaderogpeppe, if a machine is Dying it means "I will set myself to Dead when I have disacharged my responsibilities"09:34
rogpeppefwereade: what is a machine without an instance?09:34
fwereaderogpeppe, I am reluctant to stipulate that the machine agent can die with no responsibilities undischarged09:35
rogpeppefwereade: what responsibilities does a machine agent have if it has no units?09:35
fwereaderogpeppe, I suspect storage handling will come into play mostly at the machine agent level09:36
fwereaderogpeppe, but, ok -- that's a potential derail09:37
rogpeppefwereade: i just think it's weird that we'd allocate a new instance only to shut it down immediately09:37
fwereaderogpeppe, what you say makes sense, but you're not taking it far enough09:37
rogpeppefwereade: i think the provisioner can proxy for the machine agent in this instance09:37
fwereaderogpeppe, what does Dying actually mean if the unit agent can only go to Dying when it has no responsibilities left to discharge?09:38
fwereaderogpeppe, it means Dying is not a sane state for a Machine to have09:38
fwereaderogpeppe, it will become so if/when we change the rules ofc...09:39
rogpeppefwereade: sorry, you're mixing up machine dying and unit dying in a way i don't quite understand09:39
fwereaderogpeppe, shit sorry s/unit/machine/09:40
fwereades/unit agent/machine/ actually09:40
rogpeppefwereade: it sounds reasonably sane to me09:40
fwereaderogpeppe, what is the distinction between Dying and Dead for a machine?09:41
rogpeppefwereade: i think it's a pity we haven't actually implemented terminate-machine yet...09:42
fwereaderogpeppe, although, sorry, I'm derailing a little and I have no particular interest in fighting this one -- I take a similar Dying shortcut in the Deployer, actually09:43
fwereaderogpeppe, but I'm actually questioning it09:43
rogpeppefwereade: because you're saying that a machine can only go to Dying when it has no responsibilities left to discharge, but that's not the case currently09:44
rogpeppefwereade: anyone can set a machine to dying at any time09:44
fwereaderogpeppe, ok, well then that is surely crack09:44
fwereaderogpeppe, why timebomb your machines like that?09:44
rogpeppefwereade: i'm not sure why09:44
rogpeppefwereade: you might have a good reason09:45
rogpeppefwereade: you might not want a new machine to be allocated09:45
fwereaderogpeppe, the only thing that does is to say "keep this machine around for an arbitrary length of time, but don't forget the irrevocable kill command that will take effect when its current purpose is fulfilled"09:45
rogpeppefwereade: so calling terminate-machine before removing a unit means that we can ensure that's true09:45
rogpeppefwereade: that seems quite plausibly useful to me09:46
fwereaderogpeppe, but you're also suggesting that the unit should get no opportunity to shut down cleanly if the instance goes away09:46
fwereaderogpeppe, it's a total niche case09:46
fwereaderogpeppe, defaulting to shutting down machines when unused would be moreuseful09:46
fwereaderogpeppe, weeks-delayed kill commands are pretty esoteric ;)09:46
rogpeppefwereade: if we think that automatically shutting down a machine when it's unused is a good thing, then sure. but i think we've decided that it's not.09:47
fwereaderogpeppe, I am working on the asusmption that we will have some sort of persistent storage generally available, such that moving from one instance to another can be accomplished almost trivially09:47
fwereaderogpeppe, my point is that if we're going to get clever about machine termination, delayed-kill is not the top priority09:48
rogpeppefwereade: well maybe, but there is overhead in starting an instance, and state in an instance that may not be easily stored.09:48
rogpeppefwereade: i think it falls out naturally from our model.09:48
fwereaderogpeppe, yeah, depends on the provider09:48
rogpeppefwereade: and it *is* potentially useful behaviour09:49
fwereaderogpeppe, it is potentially useful behaviour that we should restrain ourselves from implementing until we understand the use cases09:49
fwereaderogpeppe, you know what09:51
fwereaderogpeppe, Unit.EnsureDead, implemented correctly, is just *horribly* complex09:52
rogpeppefwereade: because it's hard to check all the unit's dependencies before setting state to dead?09:53
fwereaderogpeppe, it needs to clean up some or all of: machine assignment, subordinates Dead-setting, relation removal, and service removal09:53
fwereaderogpeppe, if we do it correctly, we have to just build up some monster transaction09:53
fwereaderogpeppe, not to mention just cleaning up relation membership09:54
rogpeppefwereade: that's not Unit.EnsureDead - that's RemoveUnit09:54
rogpeppefwereade: EnsureDead and EnsureDying don't do anything other than set life state09:54
fwereaderogpeppe, ok, drop service removal09:54
fwereaderogpeppe, that's the only one09:54
rogpeppefwereade: it's up to the caller to make sure that the other invariants are preserved correctly.09:55
fwereaderogpeppe, ha ha09:55
fwereaderogpeppe, how is that possible?09:55
rogpeppefwereade: well usually we do that be not allowing new things to be added when something is in a dying state.09:56
fwereaderogpeppe, to make sane transitions in system state we have to do these things as single transactions09:56
Aramgood morning09:56
rogpeppeAram: hiya!09:56
fwereadeAram, heyhey09:56
fwereadeAram, nice holiday?09:56
Aramyeah.09:56
fwereadeAram, cool09:56
rogpeppeAram: is your holiday finished now?09:57
Aramyeah.09:57
fwereadeAram, I landed your watchers -- we've identified the firewaller bug and TheMue is looking into it this week AIUI09:57
TheMuefwereade, Aram: +109:57
Aramfwereade, could you please link me to the commit that fixed it?09:57
TheMueAram: Hello btw.09:57
Aramhi.09:57
rogpeppefwereade: i'm not sure we do need to do these things as single transactions09:58
rogpeppefwereade: and that's why we have the dying/dead distinction09:58
fwereaderogpeppe, Dying/Dead is about handover of responsibility surely09:58
TheMueAram: It's not yet fixed, only better identified. I'm now working on it with two CLs.09:58
fwereaderogpeppe, but any time we want to make a change to the state, we need to do it as a single transation09:59
fwereaderogpeppe, or write a CA09:59
rogpeppefwereade: CA?09:59
fwereaderogpeppe, Corrective Agent ;)09:59
rogpeppefwereade: ha09:59
TheMueAram: And LXC is right now stopped, one CL has gone in, two are open. MAAS has gotten higher priority.09:59
rogpeppefwereade: but that's not true. we don't need to make every change to the state as a single transaction09:59
Aramfwereade, I've seen a proposal to replace int with string, excellent.09:59
fwereadeAram, (there was a MUW bug that was contributing to that test failing, I'll find that commit, just a mo)10:00
rogpeppefwereade: and in this case, after the unit is set to dying, if we use several transactions to find that all its dependencies have gone away and it's in dying state, then we know we can remove it10:00
rogpeppefwereade: or set it to dead10:00
Arammeh, the damn unity panel can't be set in a different position, and auto hide doesn't work in vmware.10:01
rogpeppeAram: so run ubuntu natively :-)10:03
AramI bought a new mac.10:07
TheMueAram: It's possible to auto-hide it, have to find the switch again. Somwhere in the settings.10:08
AramTheMue, it's possible to auto hide it, it's impossible to appear again after you've done so.10:09
Aramthat's because compiz is too smart for its own good.10:09
TheMue*lol10:09
Aramit calculates how hard you've hit the screen edge.10:09
Aramsince vmware won't deliver mouse events after you've hit the edge, it can't calculate how hard you hit it.10:10
Aramso it won't show up.10:10
=== Aram2 is now known as Aram
fwereadeso, hey again all11:00
rogpeppefwereade: your network connection die?11:01
fwereaderogpeppe, power cut11:01
rogpeppefwereade: ah, not useful11:01
fwereaderogpeppe, didn't last long :011:02
fwereaderogpeppe, ok, so, the trouble with lifecycle discussions is that there are in the end fewer commonalities than one might think11:05
rogpeppefwereade: did you see my last commend ("... or set it to dead")?11:05
rogpeppecomment11:05
fwereaderogpeppe, ah, sorry, I didn't11:05
rogpeppefwereade: ah11:05
rogpeppe[09:59:49] <rogpeppe> fwereade: but that's not true. we don't need to make every change to the state as a single transaction11:05
rogpeppe[10:00:36] <rogpeppe> fwereade: and in this case, after the unit is set to dying, if we use several transactions to find that all its dependencies have gone away and it's in dying state, then we know we can remove it11:05
rogpeppe[10:00:42] <rogpeppe> fwereade: or set it to dead11:06
fwereaderogpeppe, ok, so what's the scenario you're considering there?11:06
rogpeppefwereade: i was replying to your "but any time we want to make a change to the state, we need to do it as a single transation" comment11:07
fwereaderogpeppe, yeah, and you're explaining a situation in which we don't have to worry about it, and I'm asking for more details11:07
fwereaderogpeppe, I think :)11:07
fwereaderogpeppe, who is setting the unit to dying, and why?11:07
rogpeppefwereade: i was talking about setting the unit to dead, not dying11:08
rogpeppefwereade: anyone can set the unit to dying11:08
mrammnetwork here is a bit flakey, but I'm around again for the next few hours today, and then traveling back to the US tomorrow.11:08
rogpeppemramm: i guess you'll miss the meeting then11:08
mgzdimitern: want to catch up, even though it'll only be us two?11:08
mrammrogpeppe: yea11:08
mrammrogpeppe: I also need to figure out better meeting times11:09
fwereaderogpeppe, ok, yes, that is true; it is not hard to set a unit to dead once we know it's done everything11:09
fwereaderogpeppe, but the tricky case is EnsureDead from the outside11:09
rogpeppefwereade: i don't see that's a problem. the only thing that can call EnsureDead is something that knows it can act for the object.11:10
rogpeppefwereade: which is usually the agent responsible for the object, but may not be, in some cases.11:10
fwereaderogpeppe, ok, so when someone uses remove-unit --force...11:11
fwereaderogpeppe, that client is basically taking on all the responsibilities of the unit agent, right?11:11
rogpeppefwereade: i'm not sure11:11
fwereaderogpeppe, well, the UA won't do anything else after it's dead11:12
rogpeppefwereade: i don't think the client can call EnsureDead in that case11:12
dimiternmgz: sure, i'm starting mumble now11:12
fwereaderogpeppe, its responsibilities must either be transferred elsewhere, or discharged, in the same transaction that makes it Dead11:12
rogpeppefwereade: i think it just means "unit: please remove yourself regardless of the dependencies"11:12
fwereaderogpeppe, I don't think there's any command that means "please corrupt state"11:13
rogpeppefwereade: i don't see why it all needs to happen in the same transaction11:13
fwereaderogpeppe, ok, so what happens when the first change is made and then the connection is dropped?11:13
rogpeppefwereade: all we need to do is set the unit to dying and some flag, say "force" that means that the unit will kill itself even when it has relations etc.11:14
rogpeppes/"force"/"force",/11:14
fwereaderogpeppe, please expand on what you mean by "kill itself"11:15
fwereaderogpeppe, it needs to exit the relations even if it isn't running hooks11:15
rogpeppefwereade: well, perhaps it might be good if you could explain the sematics of remove-unit --force.11:15
fwereaderogpeppe, the idea was from possibly the first lisbon11:16
rogpeppesemantics11:16
fwereaderogpeppe, make the unit Dead11:17
fwereaderogpeppe, the trouble is that "make the unit Dead" is not necessarily a simple change to state11:17
rogpeppefwereade: at a higher level, why do we want this?11:17
fwereaderogpeppe, because a broken UA is a hugely awful failure, that otherwise blocks the removal of machines, services, and relations11:17
fwereaderogpeppe, it's a feature we hope nobody will use11:18
rogpeppefwereade: ok. are we talking about a broken unit agent, or a dead instance?11:18
fwereaderogpeppe, a broken unit agent11:18
fwereaderogpeppe, that has bad code, and bad upgrading code too, and that we have no other way of removing11:18
rogpeppefwereade: so if we know it's broken, then we know we can act for it, right?11:19
fwereaderogpeppe, sure, I'm 100% comfortable with the idea that we can tak on its responsibilities11:19
fwereaderogpeppe, I'm just saying that if we do so we must either discharge them all, or transfer responsibility for doing so elsewhere, and that it must be done in the same transaction as that in which we set the unit to dead11:20
rogpeppefwereade: ok, so something else must take on its responsibilities for a while and see the unit through its last phases.11:20
fwereaderogpeppe, so you want two different sorts of Dying state11:20
rogpeppefwereade: i still don't see that last point11:20
rogpeppefwereade: no, i don't11:21
fwereaderogpeppe, we are talking about setting the unit to dead11:21
fwereaderogpeppe, there are a potentially large number of things in state that need to be changed in order for the unit to become dead and state to remain consistent11:21
rogpeppefwereade: i thought we were talking about forcing the unit to die even when its agent is broken11:21
rogpeppefwereade: that's a somewhat different thing11:22
fwereaderogpeppe, er, "setting the unit to dead" is what the unit agent would have done were it not broken, right?11:22
rogpeppefwereade: i suspect we might want another worker/agent to manage this11:22
fwereaderogpeppe, the whole point is setting it to dead11:22
fwereaderogpeppe, that is how we communicate that the unit agent can be safely trashed11:23
rogpeppefwereade: well, presumably the unit agent will manage the "potentially large number of things" along the road to deadness, yes?11:23
rogpeppefwereade: setting it to dead indicates that the unit agent *is already* trashed11:23
fwereaderogpeppe, when we set Dying, that is exactly what the uniter does, yes11:23
fwereaderogpeppe, not even slightly11:23
fwereaderogpeppe, setting it to dead is what lets its deployer know that it can be trashed11:24
rogpeppefwereade: ok, so we need something else to take on the responsibility for the work that the unit agent normally does11:24
fwereaderogpeppe, <fwereade> rogpeppe, its responsibilities must either be transferred elsewhere, or discharged, in the same transaction that makes it Dead11:24
rogpeppefwereade: ok, that's a different level of trashing11:24
fwereaderogpeppe, ok: AIUI the deployer is responsible for both kinds11:25
fwereaderogpeppe, once something is Dead, the thing responsible for it releases any underlying resources and removes it from state11:25
rogpeppefwereade: AFAICS the deployer is responsible for maintaining the container of the unit11:25
rogpeppefwereade: yes11:26
rogpeppefwereade: and that's not the problem. the problem is the transition to death11:26
fwereaderogpeppe, to Dead?11:26
rogpeppefwereade: yeah11:26
fwereaderogpeppe, yes11:26
rogpeppefwereade: and we can't solve that by simply charging in and calling EnsureDead11:27
fwereaderogpeppe, depending on what EnsureDead means, bu yes11:27
rogpeppefwereade: but i don't see that it must all be called in the same transaction either11:27
mrammhotel wifi at 25% packet loss :(11:27
fwereaderogpeppe, it sounds like yu are advocating for a corrective agent11:28
fwereaderogpeppe, or task11:28
rogpeppefwereade: perhaps you could outline the things that the unit agent does after seeing Dying and before it calls EnsureDead?11:29
fwereaderogpeppe, depart all its relations, basically11:29
rogpeppefwereade: perhaps; i'm not sure yet.11:29
fwereaderogpeppe, this is not necessarily a simple operation11:29
rogpeppefwereade: each relation depart can be done as a single transaction?11:29
fwereaderogpeppe, because some of those relations might themselves be dying11:29
fwereaderogpeppe, yes, they could11:30
rogpeppefwereade: so esssentially it does: for r in relations {r.Depart()}; u.EnsureDead() ?11:30
fwereaderogpeppe, you are proposing that we depart them each individually, and assuming that the unit agent is not currently running and will never come back?11:31
fwereaderogpeppe, remove-unit --force needs to work even if the UA suddenly wakes up11:31
fwereaderogpeppe, while the unit is not dead, the UA has responsibility for it11:31
rogpeppefwereade: if relation departing is idempotent, i think that could work11:32
fwereaderogpeppe, I am open to discussion re when/how that responsibility is transferred/discharged11:32
mramm2hotel wifi at 25% packet loss, falling back to cell phone data plan but on edge network, so only a half step above IPoAC11:33
fwereaderogpeppe, I don't think so -- I can imagine a path by which the UA could rejoin one of those relations in between the depart and the ensuredead11:33
rogpeppefwereade: can a UA rejoin a relation when the unit is marked as dying?11:33
fwereaderogpeppe, why would the unit be marked as dying?11:33
rogpeppefwereade: isn't that one of the transaction guards?11:33
fwereaderogpeppe, we're talking about forcing Dead from any state11:34
rogpeppefwereade: because that's the first thing we must do when calling remove-unit --force, surely?11:34
rogpeppefwereade: that's how we manage to shut down cleanly in multiple transactions11:34
fwereaderogpeppe, I guess that's probably not too harmful, although I am strongly -1 on state changes that are not expressed as single transactions11:36
niemeyerfwereade: How would the deployer even know to kill the unit if it wasn't market as dying11:37
niemeyerGood mornings, btw11:37
fwereadeniemeyer, heyhey11:37
TheMueniemeyer: Morning11:37
fwereadeniemeyer, the deployer removes the unit's it's responsible for when they become Dead11:37
fwereadeniemeyer, they shouldn't care that their units are Dying11:37
fwereadesorry errant '11:37
niemeyerfwereade: Ah, right, okay11:38
fwereadeniemeyer, Dying is a signal to the UA to clean itself up and mark itself Dead when it's ready11:38
niemeyerfwereade: Yeah, you're right.. something else has to mark it as Dead in that edge case being debated11:38
fwereadeniemeyer, yeah, and the requirements for the two cases are rather different, so a single EnsureDead method with no parameters is not enough to express what we need to do11:40
rogpeppefwereade: if we want it to be expressed as a single transaction, then we need an agent to do the rest for us11:41
rogpeppefwereade: call it the CA if you want11:41
fwereadeniemeyer, in a clean shutdown, the uniter shouldn't set itself to Dead until it has no remaining subordinates11:41
fwereadeniemeyer, in a forced death, we need to make all the subordinates dead as well, I think -- but I guess that is a red herring, it's just where I started the conversation from11:42
rogpeppefwereade: i don't think that remove-unit --force should simply call EnsureDead to do the work11:42
fwereadeniemeyer, the relations question is much more interesting11:42
niemeyerfwereade: It's an interesting case, actually11:43
fwereaderogpeppe, ok, sorry, I have been talking a lot11:43
fwereaderogpeppe, would you outline how how would expect the feature to work?11:43
fwereades/how how/how you/11:43
rogpeppefwereade: i'd expect the forced shutdown to go through the same phases as a non-forced shutdown11:44
rogpeppefwereade: and i would expect it to error out if the agent involved is actually alive.11:44
fwereaderogpeppe, ok, but when the unit is Dying its agent is still the responsible entity11:44
rogpeppefwereade: mebbe11:44
fwereaderogpeppe, shouldn't remove-unit --force be able to forcibly remove the unit whatever it's doing?11:45
rogpeppefwereade: yeah, probably11:45
rogpeppefwereade: in which case we need to make the shutdown phases work even when multiple entities are performing them11:45
niemeyerfwereade: It should, but if that's done when the unit is not even dying, it feels like we should do something to not create unnecessary harm11:46
fwereaderogpeppe, well, we should have been doing so anyway, right, what with the txn runners11:46
rogpeppefwereade: yes, except you were saying you can't do it all in one transaction. which seems a reasonable issue.11:47
fwereadeniemeyer, rogpeppe: yeah, I think it's fine to start remove-unit --force by setting Dying11:47
niemeyerfwereade: and having a grace period, maybe11:48
fwereadeniemeyer, rogpeppe: I think it's ok to have remove-unit always set the unit to Dying11:49
rogpeppeniemeyer: that, presumably, would mean that remove-unit --force would need to take as long as that grace period... or we'd need an agent to do it.11:49
niemeyerrogpeppe: Assuming the unit wasn't already Dying11:49
fwereadeniemeyer, rogpeppe: and then if --force is set, aggressively go around trashing its stuff until it can call EnsureDead (or finds that the unit has done so itself)11:49
rogpeppefwereade: that's what i'm thinking11:49
rogpeppeniemeyer: if it is already dying, we ignore the grace period?11:50
niemeyerrogpeppe: Yeah, I think that sounds reasonable11:50
fwereadeniemeyer, I rather feel that the grace period is unnecessary -- if we're forcing then we're stating that we don't want or need a clean shutdown, we just want it gone11:50
rogpeppeniemeyer: it seems slightly odd that. {remove-unit; remove-unit --force} is different from {remove-unit --force}11:51
niemeyerfwereade: That sounds like unnecessary mess in the system11:51
niemeyerAlternatively, we could disallow --force to be used without first calling without force11:51
niemeyerWhich would set dying11:51
niemeyerTHis would be a better teaching instrument than the grace period11:51
rogpeppeniemeyer: yes, that sounds better11:52
fwereadeniemeyer, no remove-unit --force unless already dying SGTM11:52
niemeyerfwereade: Yeah11:52
rogpeppeniemeyer: then the user can choose their own grace11:52
niemeyerrogpeppe: Right, the issue becomes obvious11:52
* fwereade is a little worried that the UA *will* be going around re-entering relations11:52
rogpeppefwereade: can it reenter a relation if the unit is dying?11:53
fwereadeniemeyer, rogpeppe: and hence that --force might have to grind away at it a bit11:53
* fwereade check11:53
niemeyerfwereade: How can it re-enter a relation if it's dying?11:53
niemeyerErm.. what Roger siad11:54
niemeyersaid11:54
fwereadeniemeyer, it shouldn't leave scope until it is completely done with the relation11:54
rogpeppefwereade: "leave scope"?11:55
niemeyerfwereade: I still don't get it11:55
niemeyerfwereade: How can it *re-enter* while dying?11:55
fwereadeniemeyer, because calling Join() when we're adding a relation we expect to do stuff with works right even if it's done twice11:56
fwereadeniemeyer, let me double-check when we leave11:56
niemeyerfwereade: I still don't see the reason why it works while Dying there11:57
fwereadeniemeyer, ok, do you agree that a unit should not leave a relation scope until it has run the relation-broken hook?11:57
fwereadeniemeyer, (possibly when UA is down something else may leave scope for it, that is ont the question right now)11:58
niemeyerfwereade: Okay11:58
niemeyerfwereade: I still don't see the connection though11:58
fwereadeniemeyer, the purpose of the scope doc is to indicate that a unit still needs the relation to be alive11:59
niemeyerfwereade: I understand that11:59
fwereadeniemeyer, a Dying unit that has not run all its hooks needs that relation to be alive11:59
niemeyerfwereade: Yes, and how did we get to re-entering relation11:59
niemeyers11:59
fwereadeniemeyer, so when it comes up, it ensures that (if it knows itself to be part of the relation) its scope doc exists11:59
niemeyerfwereade: Yep12:00
niemeyerfwereade: So..?12:00
fwereadeniemeyer, with the proposed style of remove-unit, we will be leaving its scope from outside, and it will be erroring out, coming back up, and rejoining scopes we've already exited12:00
fwereadeniemeyer, the 5s break should be enough to make that only happen once12:00
fwereadeniemeyer, maybe not at all12:00
niemeyerfwereade: Do we allow it to create scope documents even when it is dying?12:00
niemeyerfwereade: *create* scope documents12:01
fwereadeniemeyer, there's no distinction at the API level -- EnterScope could be EnsureInScope12:01
niemeyerfwereade: Can you answer the question, for once? :-)12:02
fwereadeniemeyer, yes, we allow it to create scope documents at any time we are certain that it is appropriate for it to have a state document, which includes when the unit is Dying12:02
fwereades/state doc/scope doc/12:02
niemeyerfwereade: Okay, i don't think we should allow it to create scope documents whne when it is dying12:03
niemeyerfwereade: It makes no sense to be establishing new participation in relations when the unit is dying12:03
fwereadeniemeyer, I could just as easily say it makes no sense to be messing around with a unit's state while the unit is Dying and still responsible for its own state12:04
niemeyerfwereade: You could, but I don't get what you mean by that12:04
niemeyerfwereade: I'm pinpointing a very specific case which I was hoping would be easy to agree or disagree on itself12:04
niemeyerfwereade: If the unit is not in a scope, and is in a dying state, it doesn't make sense to be joining relation it wasn't in, AFAICS12:05
fwereadeniemeyer, why are we even considering relations it's not already in?12:05
niemeyer* fwereade is a little worried that the UA *will* be going around re-entering relations12:06
fwereadeniemeyer, "at any time we are certain that it is appropriate for it to have a scope document" means "when we know we're already part of the relation"12:06
fwereadeniemeyer, if the unit agent is running and knows it should be in a relation it will call EnterScope12:06
niemeyerfwereade: There's someone else that disagreed meanwhile.. sounds like a straightforward race12:06
niemeyerfwereade: Yes, and then it's put to Dying, and that should fail12:07
fwereadeniemeyer, well, yeah, I am a bit blindsided by all of this12:07
fwereadeniemeyer, meh, no trouble, we can add that to the transaction12:07
niemeyerfwereade: Exactly12:07
fwereadeniemeyer, induce a few errors while it's going down is not really a big deal I guess12:07
niemeyerfwereade: We don't have to induce errors.. EnterScope already does verifications of that nature12:08
niemeyerfwereade: Since we already disallow entereing a dying relation12:08
niemeyerfwereade: For similar reasons, I suspect12:08
fwereadeniemeyer, we will absolutely be inducing errors by purposefully corrupting the uniter's state12:08
niemeyerfwereade: How's that "corrupting the uniter's state"?  Putting a unit to dying is a normal condition12:09
fwereadeniemeyer, looping through all its relations, leaving scope for each, while the uniter is valiantly trying to run its hooks *is* corrupting the uniter's state12:09
niemeyerfwereade: I'm talking about the case above still12:10
fwereadeniemeyer, whether or not EnterScope should work when the unit is dying? I have no problem changing that, it's not a big deal, it will make no observable difference to the system AFAICT12:11
niemeyer<fwereade> niemeyer, meh, no trouble, we can add that to the transaction12:11
niemeyer<niemeyer> fwereade: Exactly12:11
niemeyer<fwereade> niemeyer, induce a few errors while it's going down is not really a big deal I guess12:11
fwereadeniemeyer, sensible check, though, definitely a good thing12:11
niemeyerfwereade: That's the context in which you mentioned corrupting state and which I answered to12:11
fwereadeniemeyer, ok, AIUI you are advocating roger's proposed style of remove-unit --force12:12
fwereadeniemeyer, which is all about corrupting the unit's state as it runs12:12
niemeyerfwereade: I don't actually know. What was roger suggesting?12:12
fwereadeniemeyer, EnsureDying(); leave scope for each relation unit; EnsureDead12:12
niemeyerfwereade: Is there an alternative you were suggesting?12:13
fwereadeniemeyer, I had felt that the sane thing to do was to either have an EnsureDead transaction that cleans up the necessary state in one go12:13
fwereadeniemeyer, well, not necessarily sane12:14
fwereadeniemeyer, the alternatives I saw were:12:14
fwereadeniemeyer, 1) a potentially large and unwieldy transaction12:14
fwereadeniemeyer, 2) some complicated corrective agent12:15
fwereadeniemeyer, and I was not very happy with either12:15
niemeyerfwereade: I think there's another alternative that might be easier to implement12:16
fwereadeniemeyer, rogpeppe has suggested just taking joint responsibility while the UA is running, and trying to shut itself down cleanly, by shutting everything down for it -- surely inducing errors -- and then setting it to dead when that's done12:16
fwereadeniemeyer, I honestly don't like that solution much either12:16
niemeyerfwereade: Having the deployer being responsible for double-checking that the unit resources have been cleared if death was forced12:17
niemeyerfwereade: After killing the software, before removing from state12:18
fwereadeniemeyer, that STM like a special case of "complicated corrective agent"12:18
fwereadeniemeyer, but worth exploring, cool12:18
niemeyerfwereade: That sounds like cleaning resources to me..12:18
niemeyerfwereade: Can't get simpler than that12:18
niemeyerfwereade: We can't clear resources without clearing resources12:18
fwereadeniemeyer, ok, this to me somewhat changes the balance of Dying/Dead12:19
niemeyerfwereade: How? It doesn't seem to change them at all to me12:19
fwereadeniemeyer, but could probably work very nicely, once we have containerisation in place12:19
niemeyerfwereade: I don't think waiting is necessary12:19
fwereadeniemeyer, I'm pretty sure we had agreed that eg a principal should not be able to become Dead while its subordinates were still around12:20
fwereadeniemeyer, because otherwise the subordinate would be holding a reference to a dead object it was not responsible for destroying12:20
fwereadeniemeyer, and that would be a Bad thing12:20
niemeyerfwereade: Hmm.. yeah.. so how does that change the picture?12:20
fwereadeniemeyer, so setting something to Dead, and having its deployer clean up the its various other connections of the system, seems wrong to me12:21
niemeyerfwereade: Sorry for being slow, but I don't understand the underlying point being made12:22
fwereadeniemeyer, I had been working from a picture in which Dead was as good as removed from the perspective of the single entity responsible for actual removal12:22
niemeyerfwereade: --force means the thing itself can't clean up its connection to the rest of the system12:22
niemeyerfwereade: Something has to do that12:22
fwereadeniemeyer, ok, you are saying that the deployer can clean up a unit's relations after the relation is dead? or not at all?12:22
niemeyerfwereade: If you want to do that at the command line, you'll be "corrupting the state"12:22
niemeyerfwereade: The only thing that can be sure the thing is actually dead is its runner12:22
fwereadeniemeyer, yes, it is something else's responsibility to do the cleaning up12:22
niemeyerfwereade: Which is the deployer12:22
niemeyerfwereade: So that's the place we can clean up without corrupting the state12:23
niemeyerfwereade: But you don't think that's right, because..?12:23
fwereadeniemeyer, a dead unit that's still participating in relations *is* corrupt state IMO12:23
niemeyerfwereade: We can ask the deployer to force its death without putting its status to Dead12:24
mrammBTW, just sent an e-mail with updated meeting times -- and moved them to thursday for this week since I'm traveling tomorrow.12:25
niemeyermramm: Cool, cheers12:25
mgzmramm: saw that. won't be there for thursday (as I'm travelling) but the rest of our lot should be.12:25
mrammmgz: no problem.   We are bound to be missing one or two folks most weeks in december!12:26
fwereadeniemeyer, ok, so: a flag on units, checked by their deployer, that when set (1) causes the uniter to treat its unit as Dead and (2) causes its deployer to clean up its state, setit to dead, and uninstall it?12:26
mrammmgz: probably more most weeks.12:26
niemeyerfwereade: The uniter doesn't have to change.. as far as it knows, it's already Dying, so it *should* be aborting its activities12:27
fwereadeniemeyer, and so it will be12:27
niemeyerfwereade: The force flag action would happen purely on the deployer12:27
fwereadeniemeyer, ok, isn't it better for the uniter to see that someone else has taken responsibility, and just stop doing things?12:28
niemeyerfwereade: It will stop doing things, because the deployer will shoot it in the head12:28
niemeyerfwereade: There's no point in sending him a postcard telling its being shot in the head :-)12:28
niemeyer(and by now I'm probably in a list of dangerous people somewhere)12:29
fwereadeniemeyer, haha12:29
fwereadeniemeyer, this somewhat complicates the UnitsWatcher12:30
fwereadeniemeyer, or the clients I guess, I just need it to send all changes12:30
niemeyerfwereade: I don't think it should change12:30
fwereadeniemeyer, ok, so the deployer needs to set up kill-switch watches on each of its units itself?12:30
mrammalso, friendly reminder to folks: put your vacation on the Juju Calendar so we all know it.12:31
niemeyerfwereade: Although, don't we already monitor all changes12:31
niemeyerfwereade: On units12:31
fwereadeniemeyer, no, that watcher filters it to just lifecycle changes12:32
niemeyerfwereade: What does that mean in practice? Life is a field in the unit12:32
fwereadeniemeyer, yes, when it gets a unit change it discards it unless Life has changed12:33
niemeyerfwereade: Right12:33
niemeyerfwereade: That sounds like a life-related change, and is in the same place as the other settings12:33
niemeyerfwereade: We'd just be comparing Life+ForcedDeath or whatever, instead of Life12:34
niemeyerfwereade: (just a strawman for now)12:34
fwereadeniemeyer, sure, it's just a change to the watcher and a change to the deployer to handle the new possibilities12:34
niemeyerfwereade: Right12:34
fwereadeniemeyer, I'm not suggesting it's the end of the world :)12:34
niemeyerfwereade: Sure, I'm just testing waters by suggesting it's actually simple12:35
niemeyerfwereade: and looking at your face while doing that ;-)12:35
fwereadeniemeyer, it's not wrong, but it's not quite conventional either12:35
fwereadeniemeyer, eg, if we're doing that, we should be handling ports changes on the firewaller similarly12:36
fwereadeniemeyer, ie the MUW should be filtering for Life and Ports changes, not just life12:36
fwereadeniemeyer, hmm, that will save us a goroutine for every unit and probably save us a lot of complexity actually12:37
niemeyerfwereade: Uh.. that'd be a more controversial change12:37
fwereadeniemeyer, ok, this is interesting to me: what's the distinction?12:38
niemeyerfwereade: Ports are not lifecycle related12:38
niemeyerfwereade: Then we're designing an API purely based on how we designed who's using it12:38
niemeyerfwereade: Which is not generally a good idea, as it means high-coupling, and changes on one side cascade on meaningless changes on the other12:39
fwereadeniemeyer, ok, in that case all I'm really bothered about is the change to the lifecycle -- either by adding a flag, or by adding new states12:39
fwereadeniemeyer, neither fills me with joy12:39
niemeyerfwereade: Sure, but I've suggested the new flag to accommodate your other points.. we can't preserve the unit as dying, and yet know to kill its activities from outside, without knowing we should12:40
fwereadeniemeyer, I'm still not saying it's bad, just that I'm nervous about it :)12:42
niemeyerfwereade: and who kills the subordinates in such circumstance?12:42
niemeyerMust be the deployer as well, since the principal is out-of-action12:43
fwereadeniemeyer, this is entertaining, because it's actually a different deployer in that case12:43
fwereadeniemeyer, the principal had a deployer12:43
niemeyerfwereade: Well, not really12:43
niemeyerfwereade: Right12:44
niemeyerfwereade: Sorry, yes, a different deployer from the one that originally fired things12:44
niemeyerfwereade: Which brings back a point: the machiner is not necessarily exactly the same as a principaller (ugh)12:44
fwereadeniemeyer, so, all these concerns were what was leading me towards the idea that composing a transaction that asserted and did the Right Thing all in one place might be viable12:45
niemeyerfwereade: I don't understand what that means.. transactions asserting things don't solve any of the previous points I think12:45
fwereadeniemeyer, how many ops would you consider to be an unacceptably large transaction?12:45
niemeyerfwereade: You can assert whatever, and transact, whatever and it'd still be corrupting someone else's state (according to what you described as that meant)12:46
fwereadeniemeyer, composing a transaction that sets all the right things to Dead, and leaves their relation scopes, etc etc, is not intrinsically unreasonable, is it?12:46
fwereadeniemeyer, the uniter expects to become arbitrarily Dead at some point and stops calmly when it finds itself so to be12:46
niemeyerfwereade: Depends on what you consider unreasonable.. it seemed that you were unhappy about changing state underlying running software12:47
niemeyerfwereade: That's not solving anything about that12:47
niemeyerfwereade: It'll still catch all uniters off-guard12:47
fwereadeniemeyer, the uniters will hiccup once at most, and then return some specific error12:47
fwereadeniemeyer, but suddenly becoming Dead is not an unexpected occurrence12:48
niemeyerfwereade: Nothing is unexpected if we say we're fine with it :-)12:49
fwereadeniemeyer, right, we agreed some time ago that the uniter needed to cope with becoming unexpectedly dead, and that its role at that point was done12:49
niemeyerfwereade: Moments ago it sounded like there was some unhappiness about the fact the uniter is doing activities such as joining relations and whatnot while someone else was changing the game underlying it12:49
dimiternis there a difference between foo := &SomeType{} and foo := new(SomeType) ?12:50
niemeyerdimitern: Now12:50
niemeyerdimitern: No12:50
fwereadeniemeyer, ok, there is state created by the uniter, that it considers itself to own12:50
dimiternniemeyer: 10x12:50
niemeyerdimitern: We use the former12:50
niemeyerdimitern: Just out of convention12:50
fwereadeniemeyer, and there is other state that it doesn't change; it just responds to changes in it12:50
dimiternniemeyer: ok12:50
fwereadeniemeyer, ok, bah, this is not true of Dead because it *does* set its unit to Dead: but at that point it also stops watching it, or doing anything at all, so it feels kinda sensible12:51
fwereadeniemeyer, I am opposed to changing the unit's relation state from <something that does not change under the feet of a live uniter> to <something that does>12:52
niemeyerfwereade: So the one-big-transaction idea doesn't solve it, right?12:53
niemeyerrogpeppe: ping12:53
rogpeppeniemeyer: pong12:53
fwereadeniemeyer, in my mind it does, but you are correct to point out that it is a pretty fuzzy distinction, and I'm having trouble putting my finger on it12:54
niemeyerrogpeppe: Do you have a moment for a call at the top of the hour, with the cloud-green team, regarding some kind of interaction with the API?12:54
fwereadeniemeyer, I shall meditate upon this over lunch12:54
rogpeppeniemeyer: yes12:54
niemeyerrogpeppe: Cool12:54
niemeyerrogpeppe: https://plus.google.com/hangouts/_/d94c1034338161320971329404422704b987f4f912:54
niemeyerrogpeppe: I'm not there yet12:54
rogpeppeniemeyer: fetching macbook12:54
niemeyerfwereade: Sounds good, let's come back to it after lunch then12:55
fwereadeniemeyer, I just had a thought on subordinate names15:16
fwereadeniemeyer, at the moment it seems we have no way to guarantee via txn that only one subordinate can be created per principal unit15:17
fwereadeniemeyer, ie we can't assert that no document with the same service and principal exists, right?15:19
fwereadeniemeyer, but we could name them, eg, logging/wordpress/015:19
fwereadeniemeyer, which makes some sort of sense15:19
niemeyerfwereade: The two issues seem independent15:20
fwereadeniemeyer, and doesn'timpact anything else, because the only thing we can do to a unit is remove it15:20
TheMue(late) lunchtime, biab15:20
fwereadeniemeyer, and there's no clear way to remove a subordinate without removing the relation15:21
niemeyerfwereade:  bzr remove/destroy-unit?15:21
niemeyerErm15:21
niemeyerjuju15:21
fwereadeniemeyer, ok, sorry, how would you expect that to work?15:22
niemeyerfwereade: Ah, indeed..15:22
niemeyerfwereade: But that sounds pretty independent from the original point15:22
niemeyerfwereade: We're again trying to solve three problems at once15:22
fwereadeniemeyer, yeah, just a supporting detail15:22
niemeyerfwereade: A) How to name units15:23
niemeyerfwereade: B) How to remove subordinate units15:23
niemeyerfwereade: C) How to limit a single subordinate unit per service15:23
niemeyerPer principal, rather15:23
fwereadeniemeyer, I don't think we need B at this point, but it may become relevant I suppose15:23
niemeyerfwereade: I don't think we need any of them right now15:24
fwereadeniemeyer, so I'm saying: C is a problem, A may be a solution15:24
niemeyerfwereade: Why is C a problem?15:24
fwereadeniemeyer, because I am terminally suspicious of things changing state I don't expect to change, and I want to write something that will react sanely if the subordinate that was trying to be added showed up from another source15:26
niemeyerfwereade: Sorry, I can't relate the answer to the question15:27
fwereadeniemeyer, I can check that no subordinate exists before I attempt the creation transaction, but I cannot assert within the transaction that no duplicate subordinate exists, and this leaves a window in which bad things can happen15:28
fwereadeniemeyer, what of the above statement seems lacking in appropriate sanity?15:28
fwereadeniemeyer, ofc we do not need to actually change unit names to do this15:29
fwereadeniemeyer, but I *think* we do need at least to change what we keep in the _id field15:30
niemeyerfwereade: That seems like a pretty radical change15:30
fwereadeniemeyer, sure, so let's drop that bit15:30
niemeyerfwereade: Should we try to look at the problem first?15:30
fwereadeniemeyer, yes15:31
fwereadeniemeyer, do you have any thoughts on it?15:31
niemeyerfwereade: So the idea is we want a subordinate service and a principal service to spawn a single subordinate unit for each principal unit. Is that a good way to put it?15:32
fwereadeniemeyer, that every principal unit creates its own subordinate, yes15:32
niemeyerfwereade: Hmm.. no, I didnt' say anything about who creates what yet15:32
fwereadeniemeyer, er, ok, what did you mean by "spawn" then?15:33
niemeyerfwereade: I mean existance15:33
fwereadeniemeyer, so did I...15:33
niemeyerfwereade: Stuff creating its own foo seems to indicate otherwise, but okay, I'll suppose we're in agreement15:34
niemeyerfwereade: So at which point the subordinate units do get created in the state?15:35
fwereadeniemeyer, I think it happens when a principal unit in a locally scoped relation successfully enters the relation's scope, and has no subordinate15:36
fwereadeniemeyer, and I'll just shut up now15:36
fwereadeniemeyer, I can check the principal unit doc's Subordinates, and I can assert no changes to the principal unit doc, and retry as appropriate15:37
niemeyerfwereade: Hmmm, sounds sensible15:38
niemeyerfwereade: It'd be nice if we could even assert specifically that there are no subordinates of the given service there15:39
niemeyerfwereade: But I guess the language doesn't allow us to match on a prefix of a sub-entry, maybe15:39
* niemeyer looks15:39
fwereadeniemeyer, hmm, I'd expect we could but I'm not sure offhand15:39
niemeyerfwereade: Hmm.. equality does unwind the array.. I wonder if regexes work the same way15:40
* niemeyer tries it15:40
niemeyerfwereade: Works!15:42
niemeyerfwereade: http://pastebin.ubuntu.com/1408009/15:42
fwereadeniemeyer, awesome15:43
fwereadeniemeyer, right, well, I know what I'm doing re adding them, anyway :)15:43
fwereadeniemeyer, I feel like I still need to think a bit about removal based on the discussion earlier15:44
fwereadeniemeyer, I will try to grab you sometime later this evening if I can15:44
fwereadeniemeyer, thanks :)15:44
niemeyerfwereade: Actually, I think that's more like what we want: http://pastebin.ubuntu.com/1408022/15:44
niemeyerfwereade: As we can assert it15:45
fwereadeniemeyer, yep, verytrue15:45
fwereadeblast, need to pop to the shops, back imminently15:51
=== flaviamissi is now known as flaviamissi_
niemeyerfwereade_: Is there any follow up that justifies changing the type of relation ids to ints?17:43
niemeyerfwereade_: Or from ints, I guess17:43
fwereade_niemeyer, not imminent, I'm afraid17:44
fwereade_niemeyer, do you not feel the zero-value change is worth it?17:45
niemeyerfwereade_: If that's the motivation, just disallow 0?17:45
niemeyerfwereade_: I'm mainly trying to understand what's going on17:45
niemeyerfwereade_: It feels like we've been in a campaign against int keys, and I'm not sure why :)17:45
fwereade_niemeyer, also, it feels more consistent to me -- but I agree that this proposal doesn't have the weight behind it that machine ids have17:45
fwereade_niemeyer, it's fundamentally about making things that are similar look similar, because I believe that then the ways to use them better will be clearer17:47
fwereade_niemeyer, but honestly, relation ids are mainly a problem for me because of id/_id17:47
niemeyerfwereade_: I don't know.. I've never designed any software on which we had a database we tried to make ints look like strings so that they were similar17:48
fwereade_niemeyer, if we called it something other than Id, and disallowed 0, I'd probably be just as happy17:48
Aramconsistent interfaces are a virtue, see OpenVMS vs. UNIX.17:50
Aramgood night17:50
niemeyerBeing a nice person too..17:52
fwereade_niemeyer, whatever we call it I don't think we index it yet anyway17:52
niemeyerBut that's harder to get right..17:52
fwereade_niemeyer, I can understand him not wanting to get drawn into the argument :)17:54
niemeyerSounding like an ass and then leaving is indeed a great way to make friends.17:55
fwereade_niemeyer, anyway, the more I think about the relation IDs the less I care what type they are, so long as we clearly disambiguate them for Key/_id17:55
fwereade_niemeyer, that#'t the core of my discombobulation here17:56
niemeyerfwereade_: If we were to unify things and interfaces, to be honest I'd try to do the opposite of what we've been doing.. I'd make everything have a surrogate key that is an integer18:08
niemeyerfwereade_: I appreciate the advantages of that novel idea that is binary numbers :)18:09
niemeyerfwereade_: 400kb holds 100 thousand ids, in a properly balanced and aligned tree.18:10
fwereade_niemeyer, do you recall me suggesting this when I first introduced the unification idea?18:10
niemeyerfwereade_: Hmm.. not with any emphasis18:11
fwereade_niemeyer, as it is, we have consistent string _ids throughout, and a surrogate integer key on relations18:11
fwereade_niemeyer, which, it crosses my mind, we probably ought to index ;)18:11
niemeyerfwereade_: Yep18:11
fwereade_niemeyer, so my own consistency hunger is actually largely assuaged -- I just don;t like the inconsistent and/or confusing terminology :)18:12
fwereade_niemeyer, ie Name/Id/Key for various types18:13
fwereade_niemeyer, and one with an extra Id that doesn't mean what the other id means18:13
niemeyerfwereade_: It was pretty consistent before18:13
niemeyerfwereade_: Id => int18:13
niemeyerfwereade_: Name => string18:13
niemeyerfwereade_: Now it's somewhat arbitrary or consistent, depending on how you slice it18:13
fwereade_niemeyer, I guess we place different weights on different kinds on consistency18:15
fwereade_niemeyer, although I note you don't mention Key in there18:15
fwereade_niemeyer, or the fact that a casual observer might expect that an Id would be indexed18:15
niemeyerfwereade_: A non-casual observer (me) would expect it to be indexed as well18:16
fwereade_niemeyer, so, well, there is at least agreement that we need to do that :)18:16
niemeyerfwereade_: To me having different types on primary keys is really not a big deal, if that's what you meant by the weights18:17
niemeyerfwereade_: Primary keys, at least where I've been lucky to observe, tend to reflect the application model18:18
niemeyerfwereade_: A person will generally have an id, or a username.. the id is generally an integer, not a string.18:19
niemeyerfwereade_: The username, if used, is a string18:19
niemeyerfwereade_: Etc18:19
fwereade_niemeyer, are you arguing that I should reverse the machine ID change?18:22
fwereade_niemeyer, because I am not actually arguing for a type change on relation id at the moment, just a name change18:22
niemeyerfwereade_: No, I'm having a pretty high-level conversation about what we're pursuing18:22
niemeyerfwereade_: Well, there's a branch to change it up for review.. that's as close to arguing about a change as it gets :-)18:23
fwereade_niemeyer, ISTM that you are clearly going to reject this change, and I've been fighting a desparate rearguard attempt to get you to admit that, at least for morons like me, it *is* confusing to have a field called Key that serializes as _id and one call Id that serializes as id18:24
fwereade_niemeyer, and that maybe we could change it, or you could explain how we benefit by this choice of names?18:25
niemeyerfwereade_: Right, that's where our conversation started..18:26
fwereade_niemeyer, ok, you just told me that I had been arguing about the type of the field18:26
fwereade_niemeyer, I thought I had clearly conceded that point18:27
niemeyerfwereade_: You did, sorry18:27
fwereade_niemeyer, I apologise if this was unclear18:27
niemeyerfwereade_: It wasn't18:27
fwereade_niemeyer, ok -- so, I have no technical arguments for changing the type of relation.Id, but I would*really* like to change the field name18:28
fwereade_niemeyer, the Tag suggestion I made in the CL is pretty clearly bad18:28
niemeyerfwereade_: Okay, what if we introduced surrogate keys for all types18:28
fwereade_niemeyer, I would rather like that, I think, even if having separate getters might be slightly unattractive18:29
niemeyerfwereade_: Id/_id18:29
niemeyerfwereade_: ints18:29
fwereade_niemeyer, I thought the _id field would not be suitable, because we don't get the uniqueness verification from name collisions?18:30
fwereade_niemeyer, but I'd willing to skip that derail for now18:30
niemeyerfwereade_: We'll likely have to add some check on adds, yes18:31
fwereade_niemeyer, Id/_id and Name/name, each of which must be unique, would feel to me like a good thing18:31
niemeyerfwereade_: Right, and Name present only where it makes sense18:31
niemeyerfwereade_: We can also rule out zeros18:32
fwereade_niemeyer, are we thinking of a relation Key as a Name or not? :)18:32
niemeyerfwereade_: Yeah, I think that'd be fine18:32
fwereade_niemeyer, ok, cool18:32
niemeyerfwereade_: It sounds good actually, rather than just fine18:33
fwereade_niemeyer, so I *think* all the consequences here are good18:33
niemeyerfwereade_: I originally thought we could not remove the idea of machine zero, but I think any software that trusts it to be special is already broken since we don't offer this guarantee and will most certainly break it in the future18:33
niemeyerfwereade_: So we could start all valid counting from 118:34
fwereade_niemeyer, I'm +1 on making it completely unspecial :)18:34
niemeyerfwereade_: Well, it is special, as it'd become invalid :-)18:34
fwereade_niemeyer, I was sad to spot an explicit zero check in the code somewhere18:34
fwereade_niemeyer, haha, reverse special :)18:34
niemeyerfwereade_: Yeah, we've always had it, but it's always been consciously a temporary hack18:35
fwereade_niemeyer, ok, so a big Id/_id/int change would be for the better; I'm not sure how soon I can pick that up while still in the throes of subordinates18:36
niemeyerfwereade_: Understandable18:38
fwereade_niemeyer, ...and cath has just made supper, so I should leave you for a bit18:38
fwereade_niemeyer, I shall try to be on later, but no guarantees I'm afraid18:38
niemeyerfwereade_: np, thanks for the ideas18:38
niemeyerfwereade_: and have fun there18:38
fwereade_niemeyer, cheers, enjoy your evening :)18:41
niemeyerfwereade_: Thanks18:43
rogpeppei'm also off for the evening.18:44
rogpeppenight all18:44
=== flaviamissi_ is now known as flaviamissi
niemeyerrogpeppe: Have a good one too19:09
=== flaviamissi is now known as flaviamissi_
niemeyerdavecheney: Morning!22:09
davecheneyniemeyer: howdy!22:09
davecheneyniemeyer: thanks for your suggestion22:09
davecheneyour replies crossed in the either22:09
davecheneyi'll look at that test now22:10
niemeyerdavecheney: np, not sure if there's something there, but I think there might be a path towards a test22:10
davecheneyniemeyer: % time juju status -e ap-southeast-222:19
davecheneymachines:22:19
davecheney  "0":22:19
davecheney    agent-version: 1.9.422:19
davecheney    dns-name: ec2-54-252-2-107.ap-southeast-2.compute.amazonaws.com22:19
davecheney    instance-id: i-ff7b0ac522:19
davecheneyservices: {}22:19
davecheneyreal    0m2.231s22:19
davecheneyuser    0m0.288s22:19
davecheneysys     0m0.024s22:19
davecheney2 two seconds !!22:19
niemeyerdavecheney: Woha!22:20
niemeyerdavecheney: That's the fastest I've seen it run, ever!22:20
davecheneyso many fewer round trips22:20
niemeyerOkidoki23:02
niemeyerI'm heading off for the day23:02
niemeyerdavecheney: Have a good time there23:03

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