Skip to content

[bug]: Switch/CircuitMap: Make sure dangling pending circuits are removed when the switch restarts #10423

@ziggie1984

Description

@ziggie1984

Pre-Submission Checklist

  • I have searched the existing issues and believe this is a new bug.
  • I am not asking a question about how to use lnd, but reporting a bug (otherwise open a discussion).

LND Version

master

LND Configuration

Backend Version

Backend Configuration

OS/Distribution

Bug Details & Steps to Reproduce

During the review of #10049 we found out there is a small issue in the switch which could cause Payments to never resolve and stay inflight.

When the payment is sent and the switch for whatever reason crashes before setting the KeyStone in the CircuitMap, this HTLC will always remain in the CircuitMap as a pending circuit meaning that this circuit is half-open and never committed to the outgoing link.

It's is an edge case but we should eventually fis this, could maybe explain why some payments never went from INFLIGHT => Failed, because an attempt never made it to the network but the payment subsystem this it did.

PR will solve this problem and put an entry in the result store as soon as we have orphan Attempts, but they would still accumulate in the Circuit.

We should probably fix this when we move the Switch to native SQL.

Expected Behavior

Debug Information

No response

Environment

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3might get fixed, nice to havebugUnintended code behaviourhtlcswitchpaymentsRelated to invoices/payments

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions