/srv/irclogs.ubuntu.com/2015/12/17/#launchpad-dev.txt

wgrantThat is the case.00:00
wgrantSo that makes complete sense.00:00
wgrantThe question is whether your case is the same.00:00
wgrantIt's the same cycle, but is it also caused by the object getting lost due to the reset.00:01
cjwatsonDoes http://paste.ubuntu.com/14059967/ help?00:01
wgrantIt's a set.00:01
wgrantIt certainly shouldn't.00:01
cjwatsonOh, so it is00:01
wgrantIn the garbage runs there is no case in which unhook is called from within MutableValueVariable.00:02
wgrantEven if it were only added once, it would still leak.00:02
* wgrant looks for any reset hooks.00:02
wgrantAh00:03
wgrantThere are none.00:03
cjwatsoninvalidate probably won't cause this, since it does _mark_autoreload00:03
wgrantRight, exactly.00:03
wgrantabort does invalid, which does AutoReload.00:03
wgrantWhich is why this normally works.00:03
wgrantWe reset between tests, but normally abort or commit first.00:03
wgrantLook at Store.reset -- it just clears the dicts.00:04
cjwatsonYeah00:04
cjwatsonWith a "beware" comment at the top00:04
wgrantHm, but the object itself is presumably destroyed.00:04
wgrantIts destructor could tell its variables to GTFO, presumably.00:04
wgrantBut ew __del__00:04
wgrantI wonder how slow it would be to fire hooks on them all as they are reset...00:05
cjwatsonI was wondering whether the tp_traverse implementation might be incomplete00:05
wgrantHmm.00:06
wgrantIsn't the cycle legitimate?00:07
wgrantOr does PostgresConnection not refer back to the event_system?00:07
wgrantWhat would the tp_traverse bug be?00:08
cjwatsonMissing MutableVariableValue._event_system, possibly.  Just trying without C extensions to narrow it down00:09
wgrantAh, possibly.00:09
cjwatsonOK, still garbage from that, so probably a red herring.00:10
wgrant(Pdb) p gc.get_referents(gc.garbage[0])[0]['_event'] is gc.get_referrers(gc.garbage[0])[1]['_event']00:15
wgrantTrue00:15
wgrantgc.garbage[0] is the PostgresConnection00:15
wgrantSo looks legit to me.00:15
wgrantUnless we can remove a reference or use a weakref, it's uncollectable.00:15
wgrantHm, can we weakref the hook, I wonder.00:16
wgrantPresumably if the object is still known by the store, its variable will still be alive.00:16
wgrantWe only need to detect changes if we're possibly going to flush them to the store, so if we're no longer in the store it's irrelevant.00:16
wgrantRight?00:16
cjwatsonYeah, and quite a few other hooks are weakreffed00:16
wgrantOh are they00:16
wgrantSo they are00:17
cjwatsonWell00:17
cjwatsonTheir args are00:17
cjwatsonMaybe not a perfect example00:17
wgrantHmmm actually.00:17
wgrantThis may not be valid.00:18
wgrantWhat if I have the object, query 10 million other objects so it's evicted from Storm's cache, then change the mutable value, delete my reference, then flush.00:18
cjwatsonIt's a little hard to see how to get away without a reset hook.00:19
wgrantHeh and even the reset hook isn't sufficient here, I don't think.00:20
wgrantOh, unless it keeps weakrefs to even evicted objects.00:20
wgrantIn which case it would.00:20
wgrants/unless it/unless the Store/00:20
cjwatsonCache eviction could call a hook too.00:20
cjwatsonBut starts to sound rather slow.00:20
wgrantIt'd also be a weird hook00:21
wgrantBasically a "leak pls" hook.00:21
cjwatsonOr a "make changes not work" hook00:21
wgrantBecause we can't unhook _detect_changes just because the object is evicted; it may be alive elsewhere.00:21
cjwatsonYeah00:21
wgrantAh00:22
wgrant_alive is a WeakValueDictionary.00:22
wgrant_cache is separate.00:22
wgrantSo a reset hook may work.00:22
wgrantIt also can't be any slower than an abort.00:23
cjwatsonI have to go to sleep, so will pick this up in the morning if you haven't figured it out by then ...00:23
wgrantOh of course it needs _alive. Even if it's evicted from the cache it has to use the same object if it's reretrieved by key.00:23
wgrantI might end up wrapping our stores, will see.00:23
wgrantOr just replacing all our reset calls, short-term.00:24
cjwatsonThe possible slowness would be in having to go and look for hooks on ten million objects.00:24
wgrantRight, but abort and commit already do that.00:24
wgrantAnd we already do that for every test.00:24
cjwatsonOutlawing reset would probably be a reasonable stopgap.00:24
wgrantIt's terrible, but already done.00:24
cjwatsonWell, outlawing it without an immediately previous abort/commit00:25
cjwatsonThere aren't too many of those00:26
cjwatsonAnyway, sleeeeep00:26
wgrantYup,.00:27
wgrantNight, thanks for investigating.00:27
wgrantTrying to work out why I need that Milestone construction in there.00:58
wgrantThe test doesn't leave garbage unless I've created something else referring to that object since the last commit.00:58
wgranthttp://pastebin.ubuntu.com/14060983/ on top of trunk is minimal so far.01:03
wgrantcjwatson: I suspect that http://paste.ubuntu.com/14071248/ will be sufficient.05:35
wgrantIt turns out that object-deleted often doesn't get called at all, because it's only invoked by a weakref callback.05:35
wgrantAnd the objects can sometimes outlive the weakref callbacks.05:35
wgrants/weakref callbacks/weakrefs/05:35
wgrant(obviously the callback would never be invoked anyway in the uncollectable circular case, but removing the hooks also seems to eliminate at least one case of uncollectability. so hopefully it's enough)05:36
cjwatsonwgrant: I'm trying a full test run with that patch now.  Shall I land it if it checks out?11:11
wgrantcjwatson: Or even before it checks out, if you're so inclined.11:11
wgrantThe Storm test suite passes with it.11:11
wgrantAnd it's not obviously terribly wrong.11:11
cjwatsonCan you commit it to our Storm branch and I'll sort out an sdist build and an LP landing?11:12
cjwatsonI agree it seems at least plausible.11:12
wgrantWe may need to detach a couple of extra hooks in the deletion hook, but this fixes at least one case.11:13
wgrantIf it goes well I'll also merge storm trunk tomorrow, as it fixes that restricted librarian "Processing failed" thing that we run into occasionally.11:13
cjwatsonOh?  What was the change there?11:16
cjwatsonr466?11:16
wgrantIf that's the thing about making "cannot send data" ish a DisconnectionError, yes.11:19
cjwatsonYeah, that11:19
wgrantPushed up to revision 408.11:19
wgrant3 tags updated.11:19
wgrantoh no bzr what did you do11:19
cjwatsonwgrant: http://paste.ubuntu.com/14072599/ if that helps11:20
wgrantI was hoping you'd say that.11:20
wgrant0.20                 free.ekanayaka@canonical.com-20130628093022-ztq82k68kepzznxx11:21
cjwatsonBe glad I didn't reflexively "bzr up" first.11:21
wgrantAnd two lds tags11:21
wgrantHm.11:21
wgrantI wonder if I tried a merge into it at some point and it remembered the tags.11:21
wgrantHarmless, anyway.11:21
cjwatsonPresumably those are ghosts with respect to our branch, but in the same repository.11:21
cjwatsonTotal: 19377 tests, 0 failures, 0 errors in 195 minutes 26.711 seconds.14:41
cjwatsongood sign14:41
cjwatsonYay, buildbot happy again.16:16
cjwatsonwgrant: thanks!16:16
=== mgz is now known as mgz_
=== xnox is now known as xnox_2016
wgrantOh good, buildbot works.21:47
cjwatsonSomething has to (probably).22:02
wgrantIndeed...22:02

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