Skip to content

Don't complete a Transaction until all tracked processes finish #552

@binaryseed

Description

@binaryseed

Right now, async work that happens in a process that lives longer than the main Transaction process won't get included because the Transaction completes when the main process exits.

We could modify this so that we wait for that async work to finish, so that the Transaction includes it.

Not certain this will be a good idea or not, given that we have no control over how long process live for. This could cause a Transaction to stay open indefinitely, which would essentially be a memory leak.

Possible solutions:

  • By default, wait until all tracked processes finish before completing a Transaction
    • Potentially have a timeout so that there's a max time we'd wait
  • Have a function that can be called in a Transaction to flag it so that we'll wait

Issues to figure out:

  • What should the Transaction end time be? End of the initial process? End of the last async process?
  • What about Transactions manually started and stopped. We currently rely on the stop_transaction behavior in order to allow another Transaction to start right after another in the same process. The pid is the key into the Transaction here
    • This might be a blocker

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions