ert icon indicating copy to clipboard operation
ert copied to clipboard

No clean up occurs if CLI is stopped with Ctrl+C

Open oyvindeide opened this issue 3 years ago • 0 comments

Describe the bug If the CLI is stopped with Ctrl+C the simulations are not stopped, instead ert stops with ERT crashed unexpectedly with: Signal 2 received

To reproduce Steps to reproduce the behaviour:

  1. pip install ert
  2. Run experiment (Test) from CLI
  3. Press Ctrl+C

Expected behaviour Would expect to get a message, Killing simulations, please wait and that the jobs running in the queue are cancelled.

This was intended to be handled here: https://github.com/equinor/ert/blob/2a987aea12b5db4f5770e5723e1e98800499f81c/src/ert/shared/cli/main.py#L114

but because of: https://github.com/equinor/ert/blob/2a987aea12b5db4f5770e5723e1e98800499f81c/src/ert/services/_base_service.py#L48

and

def cleanup_service_files(signum: int, frame: Optional[FrameType]) -> None:
    for file_path in SERVICE_CONF_PATHS:
        file = Path(file_path)
        if file.exists():
            file.unlink()
    raise OSError(f"Signal {signum} received.")

we are raising an OSErros instead which is only caught at the very entry point.

oyvindeide avatar Oct 06 '22 07:10 oyvindeide