Skip to content

Fix or deprecate non-context manager Run #531

@kzscisoft

Description

@kzscisoft

Unfortunately non-context manager use of the Run class leads to hanging if an exception is raised:

run = Run()
raise RuntimeError

because the Run does not have access to the exception the threads within it continue leading to a hang, whereas within the context manager the Run.__exit__ method can handle exceptions in scope:

with Run() as run:
      raise RuntimeError

This makes the non-CM variant more unstable, however CMs do not work well within Jupyter notebooks as all code in scope must be within a single block. Need to discuss how to approach this issue.

There may be other use cases where the user wants to later call Run.close() as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions