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

piping pantsd output to head leads to unhandled IOError #4166

Closed
kwlzn opened this issue Jan 6, 2017 · 0 comments
Closed

piping pantsd output to head leads to unhandled IOError #4166

kwlzn opened this issue Jan 6, 2017 · 0 comments
Assignees

Comments

@kwlzn
Copy link
Member

kwlzn commented Jan 6, 2017

[illuminati source (master)]$ ./pants list 3rdparty/python: | head -10
...
Exception caught: (<type 'exceptions.IOError'>)
  File ".bootstrap/_pex/pex.py", line 326, in execute
    self._wrap_coverage(self._wrap_profiling, self._execute)
  File ".bootstrap/_pex/pex.py", line 258, in _wrap_coverage
    runner(*args)
  File ".bootstrap/_pex/pex.py", line 290, in _wrap_profiling
    runner(*args)
  File ".bootstrap/_pex/pex.py", line 369, in _execute
    return self.execute_entry(self._pex_info.entry_point)
  File ".bootstrap/_pex/pex.py", line 427, in execute_entry
    return runner(entry_point)
  File ".bootstrap/_pex/pex.py", line 445, in execute_pkg_resources
    return runner()
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/bin/pants_exe.py", line 44, in main
    PantsRunner(exiter).run()
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/bin/pants_runner.py", line 57, in run
    options_bootstrapper=options_bootstrapper)
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/bin/pants_runner.py", line 35, in _run
    return RemotePantsRunner(exiter, args, env, process_metadata_dir).run()
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/bin/remote_pants_runner.py", line 79, in run
    result = client.execute(self.PANTS_COMMAND, *self._args, **modified_env)
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/java/nailgun_client.py", line 147, in execute
    return self._session.execute(cwd, main_class, *args, **environment)
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/java/nailgun_client.py", line 70, in execute
    return self._process_session()
  File "/Users/kwilson/dev/source/.pex/install/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl.dfcf1da242f8807637b07735eb90bff845cbed67/pantsbuild.pants-1.3.0.dev3+3342022031-py2-none-any.whl/pants/java/nailgun_client.py", line 46, in _process_session
    self._stdout.flush()

Exception message: [Errno 32] Broken pipe
@kwlzn kwlzn self-assigned this Feb 1, 2017
@kwlzn kwlzn added this to the v2 engine/daemon adoption milestone Feb 1, 2017
kwlzn added a commit that referenced this issue Feb 3, 2017
…non-draining reader. (#4230)

Problem

When piping output of the pantsd thin client to e.g. head, the client will throw an unhandled Broken pipe IOError attempting to flush the now-defunct fd after head short-circuits after consuming only its needed output.

Solution

Catch Broken pipe errors and exit when encountered.

Result

Broken pipe is no longer seen.

Fixes #4166
lenucksi pushed a commit to lenucksi/pants that referenced this issue Apr 25, 2017
…non-draining reader. (pantsbuild#4230)

Problem

When piping output of the pantsd thin client to e.g. head, the client will throw an unhandled Broken pipe IOError attempting to flush the now-defunct fd after head short-circuits after consuming only its needed output.

Solution

Catch Broken pipe errors and exit when encountered.

Result

Broken pipe is no longer seen.

Fixes pantsbuild#4166
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants