ablab / spades

SPAdes Genome Assembler
http://ablab.github.io/spades/
Other
763 stars 138 forks source link

Catch SIGINT in Python wrappers and terminate all child process #167

Open nivekkagicom opened 6 years ago

nivekkagicom commented 6 years ago

Control-C from a terminal only terminates the parent Python script leaving any child processes running which have to then be terminated individually. It would be much cleaner if the Python script caught the SIGINT and terminated any child processes before terminating.

alexeigurevich commented 6 years ago

Hi @nivekkagicom, It is difficult to reproduce the problem. Could you please provide the log file to see at which step you terminate the process and what child process is still running? We run child processes via subprocess.Popen which normally handles SIGINT correctly. I suspect that the issue could be in joblib.Parallel which we use for compressing corrected reads (using system gzip utility) after read correction stage. There is a known issue of joblib failing to handle Ctrl-C: https://github.com/joblib/joblib/issues/181