Skip to content

async-flow hazard: background async ops #12467

@mhofman

Description

@mhofman

What is the Problem Being Solved?

In complex async flows it's tempting to start multiple operations in parallel or sometimes in the background.

E.g. Promise.all, or void asyncOp and later await some effect of the operation, or any variation.

The problem is that if the flow exits before this operations completes, e.g. on early error, the author might expect that background task to continue. And this is a failure mode without warning since the membrane is no longer paying attention to host vows resolving

Description of the Design

Some ideas:

  • A way for an async flow to designate a promise as dontExitUntil to keep the flow active
  • A way to diagnose any host vow that are still pending and will be ignored, either or both
    • proactively when the flow exits
    • when the vow actually settles

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions