IntersectMBO / cardano-api

Cardano API
Apache License 2.0
26 stars 23 forks source link

Add MuxError handling in FoldBlocksError #548

Closed carbolymer closed 4 months ago

carbolymer commented 5 months ago

Changelog

- description: |
    Add MuxError handling in `FoldBlocksError`. Rename `LedgerStateCondition` to `ConditionResult`.
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
   - breaking       # the API has changed in a breaking way
  # - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
   - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Moves handling of errors removed in

to cardano-api. Seems that linking of epoch state logging thread sometimes results in errors:

MuxError MuxBearerClosed "<socket: 71> closed when reading data, waiting on next header True"

or

Exception: ExceptionInLinkedThread (ThreadId 54) (MuxError (MuxIOException writev: resource vanished (Broken pipe)) "(sendAll errored)")

e.g. https://github.com/IntersectMBO/cardano-node/pull/5869/checks?check_run_id=25887156950. This change should let that error be captured by FoldBlocksError.

Also follow-up from

to make LedgerStateCondition more reusable.

Checklist