Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interrupt Transaction_pool.apply when the ledger is detached #6971

Merged
merged 6 commits into from
Dec 8, 2020

Conversation

mrmr1993
Copy link
Member

@mrmr1993 mrmr1993 commented Dec 7, 2020

This PR

  • adds a detach_signal method to ledgers triggered when
    • the ledger is closed
    • the ledger is a mask, and its parent is removed without the intention to replace it
  • adds Interruptible.Deferred_let_syntax
    • this exposes a Let_syntax module that works with ppx_let to consume Async.Deferred.ts and return Interruptible.ts
    • this allows us to make an async function interruptible without having to modify any of the code
    • this also supports let%map_open/let%bind_open, where the rhs of the binding can use the Deferred.t monad as normal.
  • converts Transaction_pool.apply to interrupt when its ledger emits a detach signal
    • this combines detach_signal and the Interruptible.Deferred_let_syntax to trigger the interrupt with minimal code changes

Open question: should we re-run the apply when it has been interrupted? As currently written, we treat it as a bad diff.

Checklist:

  • Document code purpose, how to use it
    • Mention expected invariants, implicit constraints
  • Tests were added for the new behavior
    • Document test purpose, significance of failures
    • Test names should reflect their purpose
  • All tests pass (CI will check this if you didn't)
  • Serialized types are in stable-versioned modules
  • Does this close issues? List them:

Closes #6946

@mrmr1993 mrmr1993 added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Dec 7, 2020
@mrmr1993 mrmr1993 requested a review from a team as a code owner December 7, 2020 19:31
@mergify mergify bot merged commit aa39a80 into develop Dec 8, 2020
@mergify mergify bot deleted the feature/dangling-mask-interruptible branch December 8, 2020 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch ready-to-merge-into-develop
Projects
None yet
2 participants