Skip to content

Structured concurrency, panic propagation / handling #1436

@Lorak-mmk

Description

@Lorak-mmk

Right now there are a lot of places in the driver, where we just tokio::task::spawn the test, and then let it run in the background.
This is not good:

  • Panics in such tasks are silently ignored, leading to hard to debug errors. As an example, I added a panic in code that runs on connection initialization, and executed the tests. Some tests failed, but many just hanged indefinitely! If we limit the test execution time with ntest::timeout, we will see some output about the panic. This is not enough though - if session panics during setup, we should return an error. If something panics during operation, we should catch it, log it, and either respawn affected tasks or defunct a session - in general do something else than a silent failure.
  • Such ignored tasks can run in the background, even when we no longer need them, or after we closed a session. Driver should properly cleanup after itself, not leave resources behind.

How to achieve that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions