Commits

Johannes Köster committed c6c2eab

Fixes.

Comments (0)

Files changed (1)

snakemake/executors.py

                 raise ex
             self.finish_job(job)
             callback(job)
+        except KeyboardInterrupt:
+            job.cleanup()
+            self.workflow.persistence.cleanup(job)
+            # no error callback, just silently ignore the interrupt as the main scheduler is also killed
         except (Exception, BaseException) as ex:
             print_exception(ex, self.workflow.linemaps)
             job.cleanup()
     try:
         # execute the actual run method.
         run(input, output, params, wildcards, threads, resources, log)
-    except KeyboardInterrupt:
-        # just silently stop on keyboard interrupt
-        pass
+    except KeyboardInterrupt as e:
+        # re-raise the keyboard interrupt in order to record an error in the scheduler but ignore it
+        raise e
     except (Exception, BaseException) as ex:
         # this ensures that exception can be re-raised in the parent thread
         lineno, file = get_exception_origin(ex, linemaps)