I have a python script which does remote command execution, and I want to use multiprocessing in it.
I managed to get the program itself working, but when trying to interrupt it using CTRL+C, I get the following exception, and the program doesn't terminate correctly:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
self._target(*self._args, **self._kwargs)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 102, in worker
task = get()
File "/usr/lib/python2.7/multiprocessing/queues.py", line 376, in get
return recv()
KeyboardInterrupt
Caught KeyboardInterrupt, terminating workers
What am I doing wrong?