/srv/irclogs.ubuntu.com/2013/02/01/#launchpad-dev.txt

StevenKwgrant: Hmmm, how do I return a 400.00:50
wgrantStevenK: Maybe raise a BadRequest, but I'm not sure if you can at that point.00:58
StevenKI just tried with HTTPBadRequest and that OOPSes00:59
StevenKwgrant: BadRequest also OOPSes01:06
StevenKI might be using the wrong one, since I'm pulling it from lazr.restfulclinet01:07
StevenK*restfulclient01:07
wgrantStevenK: HTTPBadRequest is probably the right one01:08
wgrantBut the request may not be sufficiently set up by then01:08
wgrantWhat does the traceback look like?01:08
StevenKwgrant: http://pastebin.ubuntu.com/1595337/01:09
wgrantStevenK: Ah, so the publisher deals with it really early01:10
wgrantMight best to go the decode('utf-8', 'replace') route01:10
StevenKRight, like PATH_INFO ?01:10
StevenKwgrant: My test might be screwing that up01:11
StevenKBut given it's three lines, maybe not01:12
wgrantLike PATH_INFO, yes01:12
wgrantIf they don't speak UTF-8 then they're not worth understanding :)01:13
StevenKwgrant: http://pastebin.ubuntu.com/1595363/01:19
wgrantStevenK: Heh, no01:19
StevenKwgrant: Would you prefer _decode() turns into return unicode(text, 'utf-801:20
StevenKBleh01:20
wgrantStevenK: Well, think about what your diff will do01:20
StevenKreturn unicode(text, 'utf-8', 'replace') even01:20
wgrantIt'll go through all the user-specified charsets01:20
wgrantDecoding each with replacements01:20
wgrantThen decode as UTF-8 with replacements01:21
wgrantWhat you might want to do is try to decode as the user-specified charsets01:21
wgrantThen, if they all fail, decode as UTF-8 replacements01:21
wgrant*or* just go ahead and decode as UTF-8 with replace to start with01:21
wgrantI'd prefer the former01:21
StevenKwgrant: http://pastebin.ubuntu.com/1595366/01:23
wgrantStevenK: No01:23
StevenKOh, missing a break01:24
wgrantIt's also wrong :)01:25
wgrantThat'll decode as utf-8 with replace if any decoding fails01:25
wgrantYou want to do it if *all* decodings fail01:25
wgrantSo perhaps you want to01:25
wgrantdef _decode(self, text):01:25
wgrant    text = super(LaunchpadBrowserRequest, self)._decode(text)01:25
wgrant    if isinstance(text, str):01:26
wgrant        text = test.decode('utf-8', 'replace')01:26
wgrant    return text01:26
wgrants/test/text/01:26
StevenKHeh01:26
StevenKwgrant: That sounds good. Even with an explanatory comment.01:28
StevenKBrowserRequest does not love adapting LBR01:29
StevenKSo I'll call it directly01:29
wgrant?01:29
wgrantOh, is it not new-style?01:29
StevenK    envadapter = IUserPreferredCharsets(self)01:30
StevenKTypeError: ('Could not adapt', <lp.services.webapp.servers.LaunchpadBrowserRequest instance URL=http:/>, <InterfaceClass zope.i18n.interfaces.IUserPreferredCharsets>)01:30
wgrantAh01:30
wgrantThat's odd...01:30
StevenKWe don't implment IBrowserRequest01:30
StevenKThat might be it01:30
=== slank is now known as slank_away
wgrantExcept that we inherit that method and it works fine01:31
StevenKWhen I copied and pasted it, it was failing with the IUserPreferredCharsets line, but I just removed it rather than looking for the import01:32
wgrantSure, but _decode is called today and seems to work fine, right?01:32
StevenKLBR doesn't have a _decode today01:34
StevenKIt will fall to the subclasses01:34
wgrantExactly01:34
wgrantWhich have the same self01:34
wgrantBut work fine01:34
StevenKAh, hm01:34
StevenKimplementing IBrowserRequest helps not01:34
StevenKNeither does calling text = BrowserRequest._decode(self, text)01:36
wgrantStevenK: So you're getting that crash in a browser?01:38
StevenKThat's from my test01:38
StevenKLet me try the browser01:38
wgrantOh01:39
wgrantYou might not even be in the right layer01:39
StevenKTestBasicLaunchpadRequest has no layer01:40
wgrantThat would be a problem for a test that desires to make use of the Component Architecture.01:40
StevenKTestLaunchpadBrowserRequest doesn't either01:40
StevenKwgrant: It works in the browser, so yeah, layers01:41
StevenKNone of the testcases in services/webapp/tests/test_servers use layers at all01:42
wgrantRight, none of them need to at present01:43
StevenKLFLayer, or is that too high?01:43
wgrantFunctionalLayer should be fine01:44
wgrantDon't even need DatabaseFunctionalLayer01:44
StevenKwgrant: http://pastebin.ubuntu.com/1595398/01:46
wgrantStevenK: Might want to extend the comment to state that we always want unicode, dammit.01:47
StevenKwgrant: http://pastebin.ubuntu.com/1595412/01:49
wgrantStevenK: Seems reasonable.01:51
wgrantChecked that it fixes the crash?01:51
StevenKIt renders the page with the replaced string in the widget01:51
StevenKSo 'good enough'01:51
wgrantYep01:52
wgrantStevenK: I'll have ~3600 lines of diff for you soon :)01:58
wgrantOver 6 branches, though01:58
StevenKWhimper01:58
wgrant:)02:05
wgrantStevenK: So, do you understand what I'm doing?02:17
wgranthttps://code.launchpad.net/~wgrant/launchpad/flatten-bfj-1-populate/+merge/145541 https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-2-garbo/+merge/145542 https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-3-query/+merge/145543 https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-3.5-more-query/+merge/145819 https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-4-app-eliminate/+merge/14582002:36
wgrantStevenK: They're ready for you to review at your leisure02:37
StevenKwgrant: You never explained your dastardly plan02:55
wgrantStevenK: I've outlined it in the MP descs03:04
wgrantBut can go into more detail if you desire03:04
StevenKwgrant: Yeah03:05
wgrantTo which? :)03:05
StevenKThe first comment03:06
wgrantAh, good :)03:06
wgrantIt's conceptually simple, there's just a lot of code to change03:06
StevenKwgrant: I've approved -1-populate with one niggle, but it took me a few minutes to figure out the the _new_* gubbins03:06
StevenKHopefully they lose their _new_ness03:06
wgrantYes03:06
wgrantThey're just there so they don't override the properties which delegate to PB/BFJ03:07
wgrantSo all the other callsites don't have to care03:07
wgrant(since the _new_ cols obviously won't be populated when the appservers first start up with that code)03:07
wgrantThey'll be renamed in -5, I suspect03:07
StevenKYeah03:07
StevenK-5-scorched-earth ? :-)03:08
* StevenK hits line of 525 of -3.5 and vomits03:29
wgrantMmm?03:30
StevenK520+ BinaryPackageBuild, Archive).find(03:30
StevenK521+ BinaryPackageBuild,03:30
StevenK522SQL(query))03:30
StevenK523resultset.order_by(03:30
StevenKIt's sort of disgusting03:31
StevenKAnd needs a rewrite03:31
wgrantAh yeah, a bit, but not in this branch :)03:31
wgrantIt needs Stormification03:31
wgrantWhich should come as part of the search rewrite in -603:31
StevenKHeh03:31
StevenKWhich branch does DROP TABLE PackageBuild, then?03:32
wgrant-7 or so, because it's not quite so urgent :)03:32
StevenKMaybe -8 can make retry-depwait a garbo-frequently job03:33
* StevenK hides03:33
wgrantNo03:33
wgrantIt takes too long03:33
wgrantIt's already a tunable loop, and could maybe be in -hourly03:34
StevenKEven with this change it will be too slow?03:34
wgrantYes03:34
wgrantThis won't affect it in any significant fashion03:34
StevenKwgrant: Up to -403:36
wgrantStevenK: Right, I originally considered having a common garbo base, but the column lists and joins for each are somewhat different, and the code will be on prod for just hours03:39
StevenKRight, exactly why I ended up with 'eh'03:39
StevenKwgrant: I'm done, all approved. -3.5 has the most niggles03:40
wgrantThanks03:40
wgrantStevenK: Can you reapprove https://code.launchpad.net/~wgrant/launchpad/flatten-bfj-3-query/+merge/146035 (no changes other than a merge from a garbo-dropping branch, which required a resubmit)03:54
wgrantYour first comment will be resolved in a later branch that rewrites the search stuff, and your second is invalid (see the next couple of lines)03:55
StevenK1013+ find_spec = find_spec + (order_by_table,)03:55
StevenKOH03:55
StevenKThat's hideous03:56
wgrantQuite!03:56
StevenKwgrant: Re-approved03:56
wgrantThanks03:56
StevenKwgrant: Blink. My test failed on buildbot, but passes locally.04:04
StevenK2.7 versus 2.6, at a guess?04:04
wgrantStevenK: Yeah04:05
wgrant2.6 eats the whole character04:06
wgrantIt assumes that the size indicated by the first byte is correct.04:06
StevenKHm, not sure how to deal with this test for both 2.6 and 2.7, then. :-(04:07
wgranthttp://bugs.python.org/issue827104:07
StevenKwgrant: Ouch04:12
StevenKwgrant: assertTrue(...['field.title'].startswith('...')) ?04:12
wgrantStevenK: I'd just check if it's one of the two known values04:12
wgrantWith an XXX04:13
StevenKRight04:13
StevenKwgrant: http://pastebin.ubuntu.com/1595628/04:19
wgrantStevenK: Looks good04:21
StevenKwgrant: -0 is waiting for stub, and I guess -1 can't land until after a FDT?04:26
wgrantStevenK: Right.04:26
wgrantMost of the fun will happen after an FDT at 1pm on Monday, I suspect04:26
wgrantThey're all in ec2 now04:27
StevenKHow many indicies do you add?04:27
wgrant(the runs are condemned due to your failure, though)04:27
wgrantUm, not sure at this point04:27
wgrantThat's for working on between 2.5 and 3 on Monday04:27
wgrantSince I can approve them myself and get ops to apply them now04:27
StevenKLast time I looked, your DB patch said TODO: add indicies04:27
wgrantI removed that while you were reviewing the rest, I think04:27
StevenKAh04:28
wgrantThere's no point creating them at that stage04:28
wgrantQuicker to create them at the end when all the data's there04:28
StevenKIndeed04:28
StevenKAnd it's not my failure, it's all 2.6's fault.04:28
wgrantTrue04:28
StevenKwgrant: Shall we deploy in about 70 minutes?04:29
StevenKMight be closer to 80, but eh04:29
wgrantSo, remaining changes: work out indices, clean up all the _new crap, drop PackageBuild itself, drop the old DB columns/table, apply various NOT NULL constraints, work out indices for the new D/DS/SPN/i_d_a queries, integrate the new D/DS/SPN/i_d_a queries04:30
wgrantAnd that should be that04:30
wgrantAnd yes, we should deploy tonight04:30
wgrantWill close 3 criticals?04:30
StevenKYah04:31
StevenKI need to find another04:31
StevenKwgrant: How can I pull apart this checkwatches core ?04:40
wgrantYou may not have much luck pygdbing it post-portem04:41
wgrantpost-mortem04:42
wgrantIdeally we'd do it in-place04:43
StevenKOn loganberry?04:45
wgrantYes04:46
wgrantstub: Thanks. Those indices were indeed planned for a quick followup, but the DEFAULT thing slip my mind this time.06:45
stubyup, I assumed the indexes would be landing soon. Just making sure those particular ones don't get lost in case you were mainly thinking about performance tuning.07:16
wgrantstub: Though it doesn't matter much for librarian-gc anyway07:17
wgrantAs it basically seqscans everything07:17
wgrantBut still useful07:17
wgrantIt's person merges that really matter, as they are selective07:18
stubmmm...07:18
stubI haven't looked for ages. I was thinking there was some selectivity in there.07:18
wgrantWell, consider what it has to do :)07:19
wgrantIt needs to find LFAs that are unreferenced07:19
wgrantWhich means finding a list of everything that is referenced07:19
wgrantThe index only helps a lot if the column is relatively sparse07:20
stubThat is one part of the algorithm. There used to be parts that benefited from the indexes. But TBO, I don't really know if that is still the case after a few years of tweaking.07:32
stubIf nothing else, deleting a single row from LFA requires looking up if that row is referenced anywhere - index lookups or table scans if the indexes don't exist.07:33
stubWhich is hundreds or thousands each gc run07:34
wgrantOh yeah, that bit is a good point.07:39
wgrantDuh07:39
=== Masklinn_ is now known as Masklinn
=== yofel_ is now known as yofel
=== Ursinha is now known as Ursinha-afk
=== matsubara-afk is now known as matsubara
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== salgado is now known as salgado-brb
=== salgado-brb is now known as salgado
=== matsubara is now known as matsubara-lunch
=== slank_away is now known as slank
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== matsubara-lunch is now known as matsubara
=== deryck is now known as deryck[lunch]
=== Ursinha is now known as Ursinha-afk
=== Ursinha-afk is now known as Ursinha
=== mpt_ is now known as mpt
=== Ursinha is now known as Ursinha-afk
=== deryck[lunch] is now known as deryck
=== matsubara is now known as matsubara-afk
=== Ursinha-afk is now known as Ursinha
=== Ursinha is now known as Ursinha-afk

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