/srv/irclogs.ubuntu.com/2013/06/13/#launchpad-dev.txt

StevenKwgrant: https://code.launchpad.net/~stevenk/launchpad/no-completed-jobs-for-celery/+merge/168859 with http://pastebin.ubuntu.com/5760296/ to claw it back to net-negative if you approve04:01
wgrantStevenK: I'm still not entirely sure that that's the right place to put it04:04
wgrantAnd we also need to handle FAILED04:05
wgrantAnd RUNNING04:05
wgrantWe handle that in the normal runner by only retrieving jobs that are WAITING04:05
wgrantIdeally the list of jobs from celery should be filtered at a similar level -- above runJob04:05
StevenKRUNNING should be handled by acquireLease04:05
StevenKwgrant: I wasn't able to figure out which code path pulls job off the queue, so we could make it skip and drop jobs that aren't WAITING04:08
wgrantStevenK: lazr.jobrunner.celerytask.RunJob.run is the relevant method.04:14
wgrantDifficult to override without just copying it04:14
StevenKIt just calls job_source.get, we could make it return None if the job is not WAITING and then have run pike if the job is None04:16
wgrantThat sounds less than ideal04:16
StevenKRight04:16
wgrantStevenK: I'd put a waitingness check between the get and acquireLease04:19
wgrantProbably just in a local override for now04:20
StevenKwgrant: But isn't that too high again? That isn't pulling stuff off the queue, it's running the job04:20
wgrantStevenK: That's the celery task04:23
wgrantIt's a RunJob task that is given to celery04:23
wgrantIt examines and runs the job04:23
wgrantIt's the appropriate level04:24
wgrantAnd indeed the highest level that isn't inside celery04:24
* StevenK stabs LP04:24
nigelbLP will stab you back... :p04:24
StevenKNow this script is causing an OOPS because it REALLY REALLY REALLY wants to send a mail04:24
StevenKnigelb: Duh. I have scars.04:25
nigelbHeh04:25
StevenKwgrant: lp.services.job.celeryjob.CeleryRunJob is a subclass of RunJob, we could check the status is WAITING pretty easily and then not call super() ?04:28
wgrantStevenK: Except that the superclass method is the bit that calls job.get04:29
wgrantI'd just override the method and we can push it upstream into that project that nobody else uses eventually04:29
StevenKwgrant: Or I could just fix it in lazr.jobrunner?04:30
wgrantStevenK: You could. I guess adding the extra bit to the interface isn't a problem, as there's only one implementation.04:31
StevenKwgrant: http://pastebin.ubuntu.com/5760341/04:49
StevenKwgrant: I couldn't work out how to get the enum into jobrunner04:50
StevenKwgrant: And I can't work out how to test it.04:54
wgrantStevenK: I'd consider 'if not job.canRun()', perhaps04:57
StevenKwgrant: Then it can go live in jobrunner if it's that.04:58
wgrantStevenK: That's the point :)04:58
=== tasdomas_afk is now known as tasdomas
StevenKwgrant: Then it turns into a two liner, because I can't work out how to get at the logger05:12
wgrantStevenK: :(05:13
StevenKwgrant: https://code.launchpad.net/~stevenk/lazr.jobrunner/only-run-if-canrun/+merge/16910505:39
wgrantStevenK: That doesn't break its tests?05:41
* StevenK finds out05:41
StevenKFileJob\\\' object has no attribute \\\'canRun\05:46
StevenKPity05:46
StevenKwgrant: This would be easier if r49 didn't fail tests locally.05:56
StevenKwgrant: From what I can see, both r49 and r51 with my changes fail locally in the same way.06:22
wgrantStevenK: Can you fix the test failure?06:22
StevenKwgrant: I don't get why r49 fails06:24
StevenKr49 being 'trunk'06:24
=== tasdomas is now known as tasdomas_afk
=== tasdomas_afk is now known as tasdomas
=== wedgwood_away is now known as wedgwood
=== tasdomas is now known as tasdomas_afk
=== wedgwood is now known as wedgwood_away
StevenKwgrant: So you're not happy wih https://code.launchpad.net/~stevenk/lazr.jobrunner/only-run-if-canrun/+merge/169105 ?23:44
wgrantStevenK: Ah, that's right, I got distracted by the test suite hanging and then other things23:48
StevenKwgrant: The test suite breaks for me locally, but the failures from trunk are identical at least23:53
wgrantStevenK: Right, now that you've fixed the test job implementation23:54
StevenKwgrant: Happy to build 0.12, stuff it into sourcedeps and then toss a branch that jumps to 0.12 at ec223:58
wgrantStevenK: As long as you also add a canRun method to the LP job implementations...23:58
StevenKOh, I thought that exists23:59
StevenK*existed23:59
StevenKLet me find the base class23:59
wgrantNo23:59
wgrantThere's actually already an is_pending method, which is WAITING/RUNNING/SUSPENDED23:59
wgrantMight be better to make canRun() is_runnable23:59

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