Skip to content

Gevent printing exception stack traces to stderr #30

@pkittenis

Description

@pkittenis

Gevent prints to stderr any exceptions that happen in a greenlet, regardless if they are handled correctly outside the greenlet.

This is a known issue with gevent and is causing stack traces for exceptions handled in ParallelSSH to be printed to stderr, for example

No handlers could be found for logger "pssh"
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/gevent/greenlet.py", line 327, in run
    result = self._run(*self.args, **self.kwargs)
  File "/usr/local/lib/python2.7/site-packages/pssh.py", line 522, in _exec_command
    proxy_port=self.proxy_port)
  File "/usr/local/lib/python2.7/site-packages/pssh.py", line 152, in __init__
    self._connect(self.client, self.host, self.port)
  File "/usr/local/lib/python2.7/site-packages/pssh.py", line 199, in _connect
    retries=retries+1)
  File "/usr/local/lib/python2.7/site-packages/pssh.py", line 199, in _connect
    retries=retries+1)
  File "/usr/local/lib/python2.7/site-packages/pssh.py", line 203, in _connect
    retries, self.num_retries,)
ConnectionErrorException: ("%s for host '%s:%s' - retry %s/%s", 'timed out', 'google.com', 22, 3, 3)
<Greenlet at 0x10746f550: <bound method ParallelSSHClient._exec_command of <pssh.ParallelSSHClient object at 0x106d5e110>>('google.com', 'date')> failed with ConnectionErrorException

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions