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

wallyworld_davecheney: hi there, i'd love a review if you have a change sometime https://codereview.appspot.com/6940069/02:53
wallyworld_also maybe https://codereview.appspot.com/6923056/02:57
davecheneywallyworld_: no probs03:00
wallyworld_awesome thanks03:00
=== davecheney is now known as geddan
geddanwallyworld___: heading off, are there any more reviews to do tonight ?07:26
fwereadebreakfast break, bbiab08:44
rogpeppemornin' all08:57
jammorning09:15
jamI'm running into a test suite hang, where I end up with a "mongod <defunct>" process, and the test suite ends up being killed after waiting 5 minutes.09:15
jamAnyone seen that and can help me fix it?09:15
jam(very reproducible, it happens with about 10 of the juju-core packages)09:16
jamrogpeppe, fwereade: ^^ ?09:16
rogpeppejam: do you know which test is hanging?09:16
jamrogpeppe: START: /home/jameinel/dev/go/src/launchpad.net/juju-core/cmd/juju/addrelation.go:0: AddRelationSuite.SetUpTest09:16
jamTestAddRelation09:17
jambut similar behavior is in a bunch of packages, so there may be a smaller one we could track down.09:17
rogpeppejam: have you got a stack dump out of it, so that we can see what line it's hanging on?09:17
jamrogpeppe: well, if I try to connect with gdb, I get a permission denied, if I try as root, it dumps a memory map, perhaps there is a back trace.09:19
rogpeppejam: i usually do it by killing the process with SIGQUITE09:20
rogpeppeQUIT09:20
jamrogpeppe: http://paste.ubuntu.com/1444879/09:20
fwereaderogpeppe, jam, heyhey09:20
rogpeppefwereade: yo!09:20
fwereadejam, sorry, I'm not familiar with that problem09:20
rogpeppejam: hmm, that's not very helpful :-)09:20
jamrogpeppe: SIGQUIT output: http://paste.ubuntu.com/1444882/09:20
jamformatting seems hard to read09:21
rogpeppejam: i agree, but i lost that argument a while ago (in go core)09:21
jamIt looks like the test is hanging in a cleanup section, possibly as a bad side effect of something failing.09:21
rogpeppejam: it looks to me as if it's hanging trying to connect to mongo09:22
rogpeppejam: ah, i see where your bad formatting is coming from09:22
rogpeppejam: you probably just typed ^\09:22
jamrogpeppe: correct09:22
rogpeppejam: which is actually ok now on go tip, i believe, but in earlier versions, go test doesn't catch the signal09:23
rogpeppejam: so you get two stack dumps interleaved09:23
jamrogpeppe: ah, interestting. new dump: http://paste.ubuntu.com/1444889/09:23
rogpeppejam: the easiest way around it is to compile the binary with go test -c, then run that09:23
jamusing "kill -SIGQUIT"09:23
rogpeppejam: is mongod actually running?09:24
jamrogpeppe: I've tried it with it alive and dead09:24
jamthat one could have been stopped09:24
jamone more with it "start/running"09:24
jamhttp://paste.ubuntu.com/1444893/09:25
fwereaderogpeppe, offhand, does a `func (*State)Info() *Info` method sound like a sensible thing to you?09:25
rogpeppefwereade: i've been wondering about that, off and on09:26
rogpeppefwereade: i *think* so. it could just return the info it was opened with09:26
fwereaderogpeppe, well, it would be very convenient for the deployer, which needs to tell its deployees how to connect09:27
rogpeppefwereade: the problem is that it's not always appropriate to use09:28
rogpeppefwereade: for instance, we might have opened the state with a localhost address, which might not be appropriate to use in a container09:28
rogpeppejam: could you try it against go tip on amd64, just to see if it's a go issue?09:29
fwereaderogpeppe, well, we're always going to be deploying things which use a modified variant of the deployer's state info anyway, so having another field to swap out isn't the end of the world I think09:29
jamrogpeppe: is there a simple way to do so?09:30
fwereadedavecheney, morning09:30
jamrogpeppe: dimitern says he sees the same thing09:30
rogpeppejam: hg clone the go repo, cd src; all.bash09:30
rogpeppejam: then set $GOROOT=your-go-repo, and rebuild09:31
rogpeppejam: (i actually have a separate juju tree that i compile against 1.0.2 rather than tip)09:31
rogpeppejam: if you just test cmd/juju on its own, do you see the same hangup?09:33
fwereaderogpeppe, but there is a minor wrinkle... so, if I expose an Info method and use that to create the deployer manager, I no longer need to pass in a separate (deploying) entity name, because that is already in the state info09:33
fwereaderogpeppe, and this mostly feels like a win, *so long as* we always want to run an agent against a state opened on that agent's behalf09:33
jamrogpeppe: yes09:34
jamthis is doing "cd cmd/juju; go test -gocheck.v -gocheck.vv"09:34
fwereaderogpeppe, that seems reasonable to me, but it will complicate the tests a bit, because the test State is not connected with an EntityName matching the arbitrary unit/machine I want to use for testing09:35
rogpeppefwereade: the entity name issue makes me feel like this might not be such a great idea09:35
rogpeppefwereade: because the info isn't just about the state, it's also about who is connecting to the state09:36
fwereaderogpeppe, well, yes, this is the property of the Info that I want to use09:36
fwereaderogpeppe, what I'm trying to figure out is whether it's ok for me to do so or whether it's icky and wrong09:37
rogpeppefwereade: it means we can't hand a state off to some code without giving them our password, which seems... i dunno, maybe it's not an issue, it just seems potentially so09:37
fwereaderogpeppe, ok, alternative: how would you feel about Addrs() and CACert() methods?09:38
rogpeppefwereade: that feels less controversial09:39
fwereaderogpeppe, ok, thanks :)09:39
rogpeppefwereade: although there's still the localhost vs non-localhost address issue09:39
fwereaderogpeppe, well, we always need CACert and we sometimes need Addrs09:39
fwereaderogpeppe, and always have to supply our own EntityName and Password09:40
davecheneyfwereade: shouldn't you be somewhere else, drinking tall drinks with umbrellas in them ?09:41
fwereadedavecheney, nah, I took a holiday on fri to synergise with the public holiday on thu, working again until EOD weds09:42
fwereadedavecheney, that said, when did a breakfast cocktail ever fail to improve the day?09:42
* fwereade falls over09:42
* rogpeppe wouldn't mind a bloody mary09:43
davecheneymmmm, rum09:44
davecheneylads, i am very happy09:44
davecheneyjuju now works properly in ap-southeast-209:44
rogpeppedavecheney: good work!09:44
davecheneyalso, if anyone see's frank09:45
davecheneyplease send my apologies09:45
davecheneyi had to roll back his change because it broke the initial auth phase09:45
davecheneyi don't know how09:45
davecheneyand I wasn't going to get into it trying to cut a release09:45
davecheneyspeaking of that does cmd/jujud import environs/openstack09:48
davecheneyi noticed that I didn't have to update the deps when doing the deb build09:48
jamdavecheney: probably not yet09:53
davecheneyjam: that is fine09:56
davecheneyit was only something i noted doing the build09:56
fwereadedavecheney, was it maybe just that the jujud tests were expecting the FW to act differently somehow (ie just hadn't been run)? or something weirder?10:04
davecheneynah, the auth code is quite touchy10:04
davecheneyrogpeppe: would you say that is a fair statement ?10:04
dimiternjam: the standup is at 10:30 or at 11 utc?10:21
rogpeppedavecheney: any auth code is touchy :-)10:27
rogpeppedavecheney: i'm interested to know how it failed BTW10:27
rogpeppedavecheney: here's an interesting little problem i found when trying to build juju for 386 (to try to replicate jam's problem)10:28
davecheneyrogpeppe: revert your working copy to r780 and see10:28
rogpeppedavecheney: if you do, GOARCH=386 GOBIN=/tmp/foo go install launchpad.net/juju-core/cmd/juju10:29
rogpeppedavecheney: the binary doesn't end up in $GOBIN10:29
rogpeppedavecheney: but in $GOBIN/linux_38610:29
rogpeppedavecheney: which means our install script in environs/tools.go fails to work10:30
davecheneyrogpeppe: yup10:30
davecheneycross compile will do that10:30
davecheneyGOHOSTARCH=386 ./all.bash10:30
davecheneymight help10:30
davecheneyis jam using 386 ?10:30
davecheneyewww10:30
rogpeppedavecheney: yes, as far as i could make out10:30
rogpeppedavecheney: see http://paste.ubuntu.com/1444893/10:31
rogpeppedavecheney: note, for instance: /build/buildd/golang-1.0.2/src/pkg/runtime/zsema_386.c:146 +0x2910:31
jamdavecheney: yes to 386 I believe10:31
rogpeppedavecheney: i'll try the GOHOSTARCH thing10:31
davecheneythose pointers are rather small :)10:31
jamdimitern: 1110:32
dimiternjam: ok, wasn't sure10:32
Aramhello.10:32
* davecheney waves at Aram10:32
jamdimitern: I run juju and launchpad in a VM to avoid having Mongo exposed to the world10:33
jamand I tend to run 386 vms10:33
dimiternAram: hiya10:33
dimiternjam: and it worked that way?10:33
davecheneyjam: honeslty, juju probalby wont' work compiled on 38610:34
davecheneywe've never considered that case10:34
davecheneyit'll probably produce a stillborn toolset using juju bootstrap --upload-tools10:35
rogpeppedavecheney: i dunno, why should it be a problem?10:35
davecheneyrogpeppe: i'm worried about a default-series kind of 'oh, we never tested that' situation10:35
rogpeppedavecheney, jam: cmd/juju tests pass for me, at any rate10:36
jamI'm pretty sure juju tests worked for me at one point. Though perhaps not on this VM. More oddly, why would it be hanging trying to talk to mgo based on CPU word size?10:44
davecheneyjam: i doubt that is the problem10:44
davecheneybut i am concerned there are assumptions baked into the tests that assume amd6410:45
davecheneyi'm pretty sure environs/ec2 image tests assume amd6410:45
rogpeppejam: just tried with latest juju trunk against i386 and all tests pass for me10:45
rogpeppejam: haven't tried live tests yet10:45
davecheneyrogpeppe: my concern is tests != juju bootstrap --upload-tools10:45
rogpeppedavecheney: exactly, i'm just gonna try live tests10:46
Aramunrelated, juju tests are sometimes flaky in a VM, especially with -gocheck.vv10:46
Aramthere's some timing issues exposed only in VMs.10:46
rogpeppedavecheney: but jam's test failures were local ones, and that's what i was trying (and failing) to reproduce10:47
jamAram: well, it fails with and without -gocheck.vv10:48
jamI just used that to see what was actually hanging, though SIGQUIT worked out better for that10:49
rogpeppeah, here's a problem:10:52
rogpeppehttp://juju-dist.s3.amazonaws.com/tools/mongo-2.2.0-precise-i386.tgz:10:52
rogpeppe2012-12-17 10:50:22 ERROR 404: Not Found.10:52
rogpeppeother than that, it all seems to have worked ok10:53
jamrogpeppe: the 386 thing is probably a red herring. dimitern is hanging as well, but he's on a amd6411:02
rogpeppejam: ah.11:02
rogpeppejam: i just wanted to make sure that i could run tests ok in a similar env to yours11:03
jamsure.11:03
rogpeppejam: (and it's an interesting experiment too...)11:03
jambtw, do you know the difference between "apt-get install mongodb" and "apt-get install mongodb-server" ?11:03
jam(I used to have nothing installed, installed mongodb-server, and it stopped the 'could not find binary' failures. I'll try installing the former and see if that changes anything)11:03
jamsame failure (in Semacquire during (*mongoCluster).AcquireSocket11:05
jamdimitern is also running on bare metal, vs a VM11:05
jamrogpeppe: rev 780 seems to fail in the same place11:09
rogpeppejam: hmm.11:10
rogpeppejam: what version of mgo are you using?11:25
rogpeppejam: (i.e. what revision number are you on?)11:25
fwereaderogpeppe, jam: lots of nice deletions in https://codereview.appspot.com/693807211:29
fwereadedimitern, and you, if you feel like reviewing ^^11:32
jammongodb-2.0.6-1ubuntu4, mgo: v2/mgo/ revno 18311:32
dimiternfwereade: 10x, I'll look at it11:32
fwereadeAram, or you, sorry, I didn't see you come on -- morning :)11:32
Aramyo11:33
rogpeppefwereade: looking11:34
jamrogpeppe: ^^11:34
jam(rev 183 of mgo)11:34
rogpeppejam: darn, same as me11:34
mrammjam: thanks for the update on dependencies, reading through it now.11:41
dimiternfwereade: FWIW you have LGTM from me12:21
fwereadedimitern, cool, thanks12:22
fwereaderogpeppe, dimitern: a followup: https://codereview.appspot.com/694405813:51
rogpeppefwereade: why conflate provisioner and firewaller? is it never reasonable to have one without the other?13:54
rogpeppefwereade: also, perhaps HostPrincipalUnits would be better as HostUnits - you can't have subordinates without principals.13:56
* dimitern looking13:56
rogpeppefwereade: (and principals imply subordinates too)13:56
fwereaderogpeppe, at the moment, we always want to run the FW and the P together, and the jobs are explicitly not meant to be 1:1 with workers14:03
fwereaderogpeppe, things may migrate in future14:03
fwereaderogpeppe, re HPA, the MA's job is to host the principal units -- those units' agents may then host subordinates, but the MA doesn't know or care about that14:04
rogpeppefwereade: from the point of view of AddMachine, i think HostUnits makes sense - we're asking that machine to host any units, and we don't care if it's the machine agent interpreting those flags, or something else.14:07
fwereaderogpeppe, I'm fine with that too :)14:11
fwereaderogpeppe, HostUnits then has an uncomfortable similarity to WatchUnits though14:11
fwereaderogpeppe, HostPrincipalUnits/WatchPrincipalUnits is clearer14:12
rogpeppefwereade: well, if you think about it, WatchPrincipalUnits is only used for the top level, but that's just an implementation detail - we want the machine to host any kind of unit in the end14:12
dimiternfwereade: done14:13
rogpeppefwereade: another thing i'm not entirely sure about: there was a nice correlation between worker constant names and the Workers function, but Host* doesn't relate strongly to "job"14:14
fwereaderogpeppe, both the jobs are currently about hosting other things14:14
fwereaderogpeppe, JobHostBlah felt over-wordy14:15
rogpeppefwereade: so if we had more constants, they might not all have a common element in the names?14:15
fwereaderogpeppe, that might be the case -- I presume you are advocating for Job*14:16
rogpeppefwereade: i'm not sure. i'm possibly advocating changing AgentJobs to HostJobs or something along that kind of line14:16
fwereaderogpeppe, am definitely fine with that14:16
fwereaderogpeppe, ah not so much with that, sorry14:16
fwereaderogpeppe, well, letme think ;)14:16
fwereaderogpeppe, I think I would maybe like HostPrincipalUnits/RunEnvironController, probably with a Job prefix14:18
rogpeppefwereade: those names seem, erm, a bit verbose14:19
rogpeppefwereade: i'm thinking that from a top-down pov, we're declaring what kinds of things a given machine will run14:20
rogpeppefwereade: so maybe RunUnits, RunEnvironController?14:21
rogpeppefwereade: i definitely think we should lose the "Principal" - we want a machine to run all units, not just principals14:21
fwereaderogpeppe, I still feel the other way re Principal, but not enough to fight it :) -- Run SGTM14:24
rogpeppefwereade: actually Task might work14:25
rogpeppefwereade: UnitsTask, EnvironControllerTask14:25
fwereaderogpeppe, uncomfortable collision with jujud.task14:25
rogpeppefwereade: that should probably be named worker14:26
rogpeppefwereade: because it corresponds to the interface implemented by workers14:26
fwereaderogpeppe, well, niemeyer is adamant that there is a distinction between a task and a worker, and an upgrader is not a worker14:26
rogpeppefwereade: hrmph14:27
fwereaderogpeppe, or that is my understanding, which is probably flawed14:27
fwereaderogpeppe, I don't think there's a meaningful distinction14:27
rogpeppefwereade: i *think* that was due to the old state Worker constants14:27
fwereaderogpeppe, ha, ok14:27
rogpeppefwereade: which were the high level description of what to do14:27
rogpeppefwereade: and i'm proposing to rename those to tasks, to make the distinction clear.14:28
rogpeppefwereade: that starts to make quite a lot of sense to me, actually.14:29
rogpeppefwereade: the machine agent uses some number of workers in order to fulfil its allocated tasks.14:29
fwereaderogpeppe, task feels a bit too singular for the intent here, I think -- in my mind I'm not thinking of workers at all, I'm thinking of tasks (ie runTasks(...task)), and I'm thinking of a Job as something that is made up of some number of tasks14:30
rogpeppefwereade: for me, "task" is a description of something to do, and "worker" is a something that accomplishes that14:30
rogpeppefwereade: "job" works ok as well as "task", but seems more like something with a defined beginning and end.14:31
rogpeppefwereade: whereas the tasks we're talking about are indefinite in extent14:31
fwereaderogpeppe, IMO "job" is a pretty good name for a group of ongoing tasks14:32
rogpeppefwereade: "job" feels like something that can be finished. then again, maybe "task" does too...14:33
rogpeppefwereade: "we task this machine with the job of running the environment controller" :-)14:33
fwereaderogpeppe, haha14:33
fwereaderogpeppe, (IMO task feels >= job re finishitude)14:34
rogpeppefwereade: ok. UnitsJob, EnvironControllerJob ?14:35
fwereaderogpeppe, I still want the common prefix for some reason14:35
fwereaderogpeppe, what's the argument the other way?14:36
rogpeppefwereade: we had Worker as a suffix before; it seems to read more nicely to me, at any rate14:36
fwereaderogpeppe, heh, it always seemed icky to me14:36
rogpeppefwereade: JobUnits seems... non-obvious. JobRunUnits perhaps14:37
rogpeppeafk, one mo14:37
fwereaderogpeppe, hmm: JobHostUnits/JobManageEnviron?14:38
rogpeppefwereade: sgtm14:39
fwereaderogpeppe, cool14:39
rogpeppefwereade: and i think the task interface *should* probably be renamed to worker, but maybe in another cl14:44
fwereaderogpeppe, I'd prefer the opposite change, I will let it stew in my mind for a bit14:45
rogpeppefwereade: renaming worker to task is a much bigger change14:45
rogpeppefwereade: we'd have to rename the whole worker package hierarchy14:45
rogpeppefwereade: (and i quite like the "worker" name currently - it seems to represent what's going on quite well)14:46
fwereaderogpeppe, (I have worse thoughts -- "task/uniter", uniter.NewTask(), etc, which would then let me get a Deployer naming I'm happy with)14:46
fwereaderogpeppe, but, anyway :)14:47
rogpeppefwereade: i'm not quite sure what you're thinking of there14:48
fwereaderogpeppe, it's really not important -- as I say I will ponder worker/task some more, and perhaps attain enlightenment14:48
dimiternrogpeppe, fwereade: PTAL https://codereview.appspot.com/694007316:35
* fwereade looks16:35
dimiternbrb16:43
dimiternback16:53
rogpeppefwereade: you've got a review17:26
fwereaderogpeppe, awesome, ty17:27
fwereaderogpeppe, I dunno -- at the moment it seems that an agent with no jobs is just not a useful thing to have17:29
dimiternrogpeppe: would you ? ^^17:29
rogpeppefwereade: it is for tests :-)17:29
rogpeppedimitern: will do17:29
fwereaderogpeppe, ha, well, yeah -- it always was, though, and that didn't stop us then ;p17:30
rogpeppefwereade: although a test for no jobs in AddMachine seems reasonable too17:30
fwereaderogpeppe, there is one, isn't there?17:30
rogpeppefwereade: quite likely, i didn't check17:31
fwereaderogpeppe, I think I wrote one :017:31
fwereaderogpeppe, +1 on MachineJob, I think17:32
rogpeppefwereade: cool17:32
fwereaderogpeppe, then I guess Jobs() rather than AgentJobs()17:32
rogpeppefwereade: didn't i suggest that?17:32
fwereaderogpeppe, ha, hadn;t read far enough17:32
fwereaderogpeppe, not sure about the bitmask though -- feels like going to extra effort to restrict the number of jobs we have and make it fiddlier to add or remove them (when we eventually want to do that)17:34
rogpeppefwereade: i don't think it makes it any fiddlier to add or remove jobs17:34
rogpeppefwereade: and i think most logic gets simpler17:34
fwereaderogpeppe, more complicated txn retries anyway, surely17:34
rogpeppefwereade: (no need to check for dupes for example)17:35
rogpeppefwereade: why is the txn retry more complicated?17:35
rogpeppefwereade: we're just setting an integer, no?17:35
fwereaderogpeppe, $addToSet?17:35
fwereaderogpeppe, we can $addToSet and $pull jobs out of an []int without having to mess around retrying because we're trying to store bitmask X which was dervived from Y which has become Z in the meantime17:36
rogpeppefwereade: we don't want to use that for jobs, do we?17:36
fwereaderogpeppe, won't we?17:37
fwereaderogpeppe, so the bootstrap machine will be the single bootstrap machine forever?17:37
fwereaderogpeppe, (forgive the terminology)17:37
rogpeppefwereade: there's nothing to say we can't change the jobs for a machine; it just means we can't have an AddJob/RemoveJob API rather than a SetJobs API.17:40
rogpeppefwereade: ... which is quite possibly a sufficient reason17:40
fwereaderogpeppe, I *think* it is... or at least it looks close enough from here17:41
rogpeppefwereade: but even if we store stuff in the database as []int, we could still have a bitmask as the externally visible API17:41
fwereaderogpeppe, is there some advantage of a bitmask I'm not seeing? it seems strictly worse to me -- by the time we have enough flags we care about the extra space of an [], we have enough flags that we're worried about space in a bitmask17:42
rogpeppefwereade: it's not about space17:42
fwereaderogpeppe, not looping through it?17:42
rogpeppefwereade: it's about the ease of checking for membership and the automatic duplicate deletion17:42
fwereaderogpeppe, how common are these operations, and how much code do we waste each time we do them?17:44
rogpeppefwereade: not that common - most code never manipulates a set of jobs. maybe 8 or so lines in the places we do.17:44
rogpeppefwereade: to me, a bitmask represents like a natural representation of a set17:45
rogpeppes/represents/seems/17:45
fwereaderogpeppe, to me, it's something I use when there's a compelling reason to pack stuff into a small space and never besides :)17:46
rogpeppefwereade: ha17:46
rogpeppefwereade: C vs Python background i guess :-)17:46
Arambitmaks are awesome.17:46
fwereaderogpeppe, it's not like I *didn't* spend time up to my elbows in bits, it's just that that time was not generally otherwise representative of sensible development practices ;)17:47
rogpeppefwereade: using bitmasks as sets actually works pretty well, and isn't unsafe17:48
fwereaderogpeppe, still feels like an [] is the more natural mongo representation, and I'm still not sure the other benefits really outweigh that17:50
rogpeppefwereade: i think i agree with that. seems like a pity that mongodb doesn't have bitwise ops, but there we go17:51
fwereaderogpeppe, cool, cheers17:53
fwereadedimitern, I'm afraid cath has just gone out without laura, so I won't finish your review any time soon: probably tomorrow :(17:57
dimiternfwereade: sure, no probs17:58
fwereaderogpeppe, dimitern, Aram: but I do have another CL for a horrifying moronic uniter bug: https://codereview.appspot.com/694607117:58
fwereadeI would very much appreciate reviews of that17:58
rogpeppefwereade: a surprisingly large change for such a small bug :-)18:00
rogpeppedimitern: sorry, run out of time on your review. FWIW, i got stuck on getId. i couldn't work out whether it's the right function with a dubious doc comment, or if it should be refactored somehow18:13
* rogpeppe is off for the evening. g'night all.18:17
=== flaviamissi is now known as flaviamissi_
=== flaviamissi_ is now known as flaviamissi
=== carif_ is now known as carif
davecheneyfwereade: ping23:35

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