Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pantsd does not react well to truncated stdout #8243

Closed
stuhood opened this issue Sep 5, 2019 · 1 comment · Fixed by #9722
Closed

pantsd does not react well to truncated stdout #8243

stuhood opened this issue Sep 5, 2019 · 1 comment · Fixed by #9722
Assignees
Labels

Comments

@stuhood
Copy link
Member

stuhood commented Sep 5, 2019

./pants --enable-pantsd list :: | head
...seemingly exits cleanly. But the pantsd log does not show the run completing, and the next call in the same workspace will block with the:

Another pants invocation is running. Will wait forever for it to finish before giving up.
If you don't want to wait for the first run to finish, please press Ctrl-C and run this command with PANTS_CONCURRENT=True in the environment.
...

...message, presumably because the first run did not exit cleanly.

@blorente
Copy link
Contributor

This one is very weird, because it happens reliably, but only after a certain amount of ouput has been truncated:

  • Small output, but still truncated. I can repeat it as many times as I want:
$ ./pants  --enable-pantsd list src/scala::  | head
src/scala/org/pantsbuild/zinc/analysis:analysis
src/scala/org/pantsbuild/zinc/extractor:extractor
src/scala/org/pantsbuild/zinc/options:options
src/scala/org/pantsbuild/zinc/compiler/native-image-substitutions:native-image-substitutions
src/scala/org/pantsbuild/zinc/compiler/native-image-substitutions:statics
src/scala/org/pantsbuild/scoverage/report:report
src/scala/META-INF/native-image/org/pantsbuild/zinc/compiler:zinc-native-image-configuration
src/scala/org/pantsbuild/zinc/cache:cache
src/scala/org/pantsbuild/zinc/scalautil:scalautil
src/scala/org/pantsbuild/zinc/util:util
  • Sightly larger output:
$ ./pants  --enable-pantsd list src/python::  | head
src/python/pants/rules/core:core
src/python/pants/rules/core:tests
src/python/pants/base:build_environment
src/python/pants/base:build_file
src/python/pants/base:build_file_target_factory
src/python/pants/base:build_root
src/python/pants/base:cmd_line_spec_parser
src/python/pants/base:deprecated
src/python/pants/base:exception_sink
src/python/pants/base:exceptions
  • Let's truncate it even more:
$ ./pants  --enable-pantsd list src/python::  | head -n 1
src/python/pants/rules/core:core
  • Let's have even more output:
$ ./pants  --enable-pantsd list src/::  | head -n 1
src/python/pants/rules/core:core
  • It only crashes for :::
$ ./pants  --enable-pantsd list ::  | head -n 1
//:3rdparty_directory
Exception ignored in: <_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>
BrokenPipeError: [Errno 32] Broken pipe

@stuhood stuhood self-assigned this May 7, 2020
stuhood pushed a commit that referenced this issue May 13, 2020
### Problem

The setup and teardown of each request made to the nailgun server in `pantsd` had become quite complicated over time... and consequently, slower than it needed to be.

### Solution

Port `pantsd`'s nailgun server to rust using the `nails` crate. Additionally, remove the `Exiter` class, which had accumulated excess responsibilities that can instead be handled by returning `ExitCode` values. Finally, fix a few broken windows including: double logging to pantsd, double help output, closed file errors on pantsd shutdown, and redundant setup codepaths.

### Result

There is less code to maintain, and runs of `./pants --enable-pantsd help` take `~1.7s`, of which `~400ms` are spent in the server. Fixes #9448, fixes #8243, fixes #8206, fixes #8127, fixes #7653, fixes #7613, fixes #7597.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants