lilydjwg/pssh

TypeError: 'int' object is not callable (in clear_sigchld_handler)

StanleyP opened this issue · 3 comments

Hello and first of all thank you for keeping the pssh project alive!

We've been using pssh to parallel deploy to many VMs with great success.
But there is one bug that we've not been able to mitigate or workaround in any way.

The problem is that sporadically pssh fails with following error:

Traceback (most recent call last):
File "/usr/local/bin/parallel-ssh", line 4, in
import('pkg_resources').run_script('pssh==2.3.4', 'pssh')
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 666, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 1453, in run_script
exec(script_code, namespace, namespace)
File "/usr/local/lib/python3.7/dist-packages/pssh-2.3.4-py3.7.egg/EGG-INFO/scripts/pssh", line 117, in
File "/usr/local/lib/python3.7/dist-packages/pssh-2.3.4-py3.7.egg/EGG-INFO/scripts/pssh", line 92, in do_pssh
File "/usr/local/lib/python3.7/dist-packages/pssh-2.3.4-py3.7.egg/psshlib/manager.py", line 77, in run
File "/usr/local/lib/python3.7/dist-packages/pssh-2.3.4-py3.7.egg/psshlib/manager.py", line 128, in update_tasks
File "/usr/local/lib/python3.7/dist-packages/pssh-2.3.4-py3.7.egg/psshlib/manager.py", line 97, in clear_sigchld_handler
File "/usr/lib/python3.7/signal.py", line 47, in signal
handler = _signal.signal(_enum_to_int(signalnum), _enum_to_int(handler))
TypeError: 'int' object is not callable

Do you have any idea how to solve this? It seems as the error triggers some bug or race condition in python itself.
Do you think it would be ok to skip clear_sigchld_handler during finalization altogether?

Would be very glad for any kind of help.

It seems to be this bug and the code was there to work around an ancient bug. I'll see if it can be simplified a bit later.

It should have been fixed (the awkward workaround is removed).

Thanks a lot for such a quick resolution of the issue!
Unfortunatelly I am not able to reproduce the bug on purpose, it occurs very sporadically.
Will pull your fix immediatelly and report back after some time.