IRC logs for #buildstream for Monday, 2020-06-15

*** tristan has quit IRC04:49
*** hasebastian has joined #buildstream04:58
*** hasebastian has quit IRC05:00
*** tristan has joined #buildstream05:02
*** ChanServ sets mode: +o tristan05:02
tristanI'm confused, why do some objects implement __getstate__/__setstate__, while other objects implement get_state_for_child_job_pickling() ?05:16
tristanI find references to get_state_for_child_job_pickling() in jobpickler.py, but I cannot find where this interface is documented05:17
juergbitristan: a reason is that we also have non-job subprocesses (cache usage monitor)05:34
juergbidon't know whether that's the only reason. also not sure why we can't simply use getstate/setstate for everything (maybe some pickling aspects are specific to job subprocesses)05:35
juergbiget_state_for_child_job_pickling() appears to be implemented by Loader and Messenger, and used by jobpickler05:35
tristanyeah05:45
tristanjuergbi, I came across https://gitlab.com/BuildStream/buildstream/-/merge_requests/1463#note_19246462005:46
tristanand I'm looking at just nulling out the project Includes() instance and the project Loader instances for all loaded projects directly at the end of Stream._load(), hopefully removing this stuff05:47
tristanBut basically, this job pickling is killing me at every turn05:47
tristanMy whole branch has been failing the multiprocess job for an issue in PluginFactory, not because my branch changes anything in that area (it doesnt), but because I've added tests which exercise the core a bit more05:49
tristanNow my loader refactor is also failing this pickling05:49
juergbi:-/ it would be good if someone picked this up again (assuming there is still interest in native Windows)05:50
tristanI think I have a clue as to why it's failing in the plugin factory, it's after the cross-plugin junctions05:51
tristanhttps://gitlab.com/BuildStream/buildstream/-/blob/master/src/buildstream/_scheduler/jobs/jobpickler.py#L151 <-- this bit seems to assume that a plugin is associated to a factory (and not the multiple factories it might have to traverse in order to find the factory which initially produces the plugin)05:53
tristannot sure though, that code is very cryptic and undocumented05:53
tristanSweet, now when I run: BST_FORCE_START_METHOD="spawn" tox -e py37 -- tests/format/include.py::test_include_junction_file ... it hangs for hours05:56
tristanBut if I do a `tox -e venv /bin/bash` and run `BST_FORCE_START_METHOD="spawn" bst -C  .tox/py37/tmp/test_include_junction_file0/junction/ show --deps none element.bst` from there (the equivalent of the test case in question); it just works fine05:56
tristanI think if we wanted to support this picklejobber, we should have a base BstObject class which just lists the members it wants wiped out at pickle time, and does the assertions that those members actually exists on the class and does the __getstate__/__setstate__ stuff automatically05:59
tristanThis `assert "foo" in state` is very delicate, and the sprinkling of these methods all over the place don't appear to make much sense upon reading06:00
*** finnb has quit IRC06:03
tristanjuergbi, do you know of any way to get the stderr/stdout of a hanging test run in tox ?06:06
tristanClearly something is wrong in there06:06
juergbitristan: -s doesn't show anything?06:07
tristanTesting with pytest directly in a tox venv doesnt cause a problem, and when I add sys.stderr.write("DEBUG STUFF") in _pickle_child_job_data() in the pytest side, it's not even triggering06:07
tristanjuergbi, that never worked06:08
tristanjuergbi, -s only prints the output of the test once it's finished06:08
juergbitristan: may need to disable output capturing in our cli class06:08
juergbiand then use -s06:08
tristan:-S06:08
juergbior kill the process when it's hanging and hope for a backtrace?06:09
tristanmaybe that06:09
juergbidepends on where/why it's hanging, I suppose06:09
tristanI've got `python -c from multiprocessing.semaphore_tracker import main;main(17)` and `python -c from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=18, pipe_handle=20) --multipr.........`06:10
tristanhah, no killing both just makes them zombies and it just continues to hang06:12
tristanjuergbi, Hacking runcli.py indeed is the only way06:15
tristanOk if I could get this error https://gitlab.com/BuildStream/buildstream/-/blob/master/src/buildstream/_stream.py#L1646 to tell me *what* is referring to Stream, then I might get somewhere, at least through this hurdle, land my changes, and then start a larger discussion about what to do with this obnoxious stick jammed into our front wheel06:17
juergbitristan: the backtrace of the error doesn't say? or is there no backtrace?06:19
tristanjuergbi, https://bpa.st/7TEA06:20
tristannot helpful06:21
tristanjust says "Dont pickle streams", but the stack doesnt have context through referees06:21
tristanmaybe pickle.Pickler(pickled_data) has some options for this06:22
tristanHas anyone ever been able to successfully use pdb with BuildStream, and if so, were they able to do it in a tox test context ?06:41
* tristan has tried to get that thing to work years ago and gave up with pdb06:42
tristanclue: This stuff happens during subproject fetch time mostly07:18
tristanSo we cannot realistically break references to Stream while performing a subproject fetch07:19
tristanWell, we should be able to cause the subproject fetch callback to _not_ be a Stream method07:20
* tristan can't help feeling the sting of how much of a waste of time it is to be trying to fix this halfway implemented thing07:44
*** santi has joined #buildstream08:48
*** tristan has quit IRC09:04
traveltissuestristan, i've used pdb in a very limited way but it involved trawling through a huge stack, not via tox though09:23
*** tristan_ has joined #buildstream10:09
*** ChanServ sets mode: +o tristan_10:09
tristan_juergbi, Can I get a review on https://gitlab.com/BuildStream/buildstream/-/merge_requests/1964 ?10:24
tristan_At least for that refactor, I was finally able to tiptoe around the pickle jobber10:24
juergbiwill take a look10:25
tristan_!1901 still has an issue with the pickle jobber, and I still have to figure out duplicate markers on overridden junctions10:25
tristan_But !1964 paves the way for !1901 well10:25
*** tristan_ has quit IRC11:37
*** tristan_ has joined #buildstream12:16
*** ChanServ sets mode: +o tristan_12:16
*** tristan_ is now known as tristan12:17
*** santi has quit IRC14:08
*** santi has joined #buildstream14:10
*** santi has quit IRC17:02
*** toscalix has joined #buildstream18:29
*** xjuan has joined #buildstream20:12
*** toscalix has quit IRC21:32

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