hundreds-father-404
06/08/2021, 7:56 PMPyNailgunClient
. But killing Pantsd results in this:
The pantsd process was killed during the run.
If this was not intentionally done by you, Pants may have been killed by the operating system due to memory overconsumption (i.e. OOM-killed). You can set the global option `--pantsd-max-memory-usage` to reduce Pantsd's memory consumption by retaining less in its in-memory cache (run `./pants help-advanced global`). You can also disable pantsd with the global option `--pantsd` to avoid persisting memory across Pants runs, although you will miss out on additional caching.
If neither of those help, please consider filing a GitHub issue or reaching out on Slack so that we can investigate the possible memory overconsumption (<https://www.pantsbuild.org/docs/getting-help>).
Traceback (most recent call last):
File "/Users/ericarellano/code/pants/src/python/pants/bin/pants_loader.py", line 100, in run_default_entrypoint
exit_code = runner.run(start_time)
File "/Users/ericarellano/code/pants/src/python/pants/bin/pants_runner.py", line 86, in run
return remote_runner.run()
File "/Users/ericarellano/code/pants/src/python/pants/bin/remote_pants_runner.py", line 99, in run
return self._connect_and_execute(pantsd_handle)
File "/Users/ericarellano/code/pants/src/python/pants/bin/remote_pants_runner.py", line 131, in _connect_and_execute
return PyNailgunClient(port, executor).execute(command, args, modified_env)
native_engine_pyo3.PantsdClientException: The pantsd process was killed during the run.
If this was not intentionally done by you, Pants may have been killed by the operating system due to memory overconsumption (i.e. OOM-killed). You can set the global option `--pantsd-max-memory-usage` to reduce Pantsd's memory consumption by retaining less in its in-memory cache (run `./pants help-advanced global`). You can also disable pantsd with the global option `--pantsd` to avoid persisting memory across Pants runs, although you will miss out on additional caching.
If neither of those help, please consider filing a GitHub issue or reaching out on Slack so that we can investigate the possible memory overconsumption (<https://www.pantsbuild.org/docs/getting-help>).
We only want that message to be printed once, not twice.
This gets me wondering if that's probably because with Rust-CPython we have functions like maybe_set_panic_handler
, and those prob don't apply to the PyO3 extension too?PyExecutor
being defined in both cpython and PyO3. I do wonder if this migration needs to be done all at oncewitty-crayon-22786
06/08/2021, 9:04 PMThis gets me wondering if that’s probably because with Rust-CPython we have functions likethe panic handler is a rust concept rather than anything related to Python, so probably not., and those prob don’t apply to the PyO3 extension too?maybe_set_panic_handler
hundreds-father-404
06/08/2021, 9:05 PMwitty-crayon-22786
06/08/2021, 9:05 PMstr
or repr
of the exception type changed…?hundreds-father-404
06/08/2021, 9:08 PMit doesn’t seem like a fundamental issueFair, maybe I'll figure out what's going on when I have fresh eyes re the
PyExecutor
awkwardness, that awkwardness is probably better than the risk of one huge PRmain
behaves the same way. Yay!witty-crayon-22786
06/08/2021, 10:29 PM--print-stacktrace
artifact…?hundreds-father-404
06/08/2021, 10:29 PM./pants lint
now logs to the log file rather than console: https://github.com/pantsbuild/pants/pull/12184/commits/71b4220eaa2c57a85da5681ead7028e01bc0c160
I double checked my port and am pretty confident I did it one-for-one, except for using Python.allow_threads()
in more places. Removing that doesn't make a difference
Any ideas?witty-crayon-22786
06/09/2021, 3:34 PMDestination
isn’t set on the appropriate thread.hundreds-father-404
06/09/2021, 3:37 PMwitty-crayon-22786
06/09/2021, 3:38 PMhundreds-father-404
06/09/2021, 4:08 PMLogger::init()
isn't applying properly? Iiuc the two Rust extensions are isolated from each otherwitty-crayon-22786
06/09/2021, 5:29 PMhundreds-father-404
06/09/2021, 5:30 PMwitty-crayon-22786
06/09/2021, 5:30 PMhundreds-father-404
06/09/2021, 5:32 PMIt's plausible we could get PyO3 to understand Rust-CPython or vice versa, but this is messy.I think a main reason I'm concerned about this is we do want to make some improvements to our FFI, e.g. no longer using the
with
context managers. Navigating that interop seems pretty complexwitty-crayon-22786
06/09/2021, 5:32 PMhundreds-father-404
06/09/2021, 5:35 PMall_metrics()
and match_path_globs
. Which means ~80% of the migration would be a single PR, unless we try to interoporate between the frameworkswitty-crayon-22786
06/09/2021, 5:35 PMhundreds-father-404
06/09/2021, 5:39 PMi can spend some time looking at the stdio issue if you’d like.If you have the time, that'd be great. I pushed this morning a change to stop using
py.allow_threads(||)
on trivial functions b/c maintainer explained there's some overhead to it. So it's more of a 1-1 comparison with the original rust-cpython now
but, of course, this port isn't our highest priority. Altho I do think it gives some good cleanup + facilaties usign py.allow_threads(||) morewitty-crayon-22786
06/09/2021, 5:44 PMhundreds-father-404
06/09/2021, 5:51 PMwitty-crayon-22786
06/09/2021, 5:51 PMhundreds-father-404
06/09/2021, 5:54 PM./pants run build-support/bin/changelog.py
fails with Exception(\'Cannot start Exclusive access on Destination Logging\')
witty-crayon-22786
06/09/2021, 5:54 PMstdio_thread_console_set
is not doing the right thinghundreds-father-404
06/09/2021, 5:57 PMfrom pants.engine.internals import native_engine_pyo3 as native_engine
witty-crayon-22786
06/09/2021, 5:57 PMhundreds-father-404
06/09/2021, 6:32 PMstdio_thread_console_set
and see the destination as:
Destination(Mutex { data: Console { console: Console { stdin_handle: Some(File { fd: 0, path: "/dev/ttys000", read: true, write: true }), stdout_handle: Some(File { fd: 1, path: "/dev/ttys000", read: true, write: true }), stderr_handle: Some(File { fd: 2, path: "/dev/ttys000", read: true, write: true }) } } })
I gotta get going though. Thanks for helping with this and talking me down with the incremental migration thing!witty-crayon-22786
06/09/2021, 7:48 PMArc<Destination>
that is being used in the spawned threads is actually the right one.hundreds-father-404
06/09/2021, 7:49 PMwitty-crayon-22786
06/09/2021, 8:13 PMhundreds-father-404
06/09/2021, 8:15 PM