Repository navigation
xpay: stop treating completed commands as ongoing - #9717
Open
darioAnongba wants to merge 1 commit into
Open
darioAnongba wants to merge 1 commit into
darioAnongba wants to merge 1 commit into
Conversation
Andezion
reviewed
Nov 9, 2026
Collaborator
|
We don't want merge commits here, please remove it. |
payment_give_up clears payment->cmd when it returns a final failure, but keeps the payment in xpay->payments until asynchronous requests and private layer removal finish. attempt_ongoing currently treats that cleanup-only entry as active, so listpays can return pending after xpay has failed even when all its parts have failed. Require an active command when checking whether xpay is still trying the payment. listpays continues to report pending when an HTLC is unresolved through its existing PAYMENT_PENDING check. Add a regression which holds askrene-remove-layer after the final xpay error and checks listpays before releasing cleanup. Exercise both normal and slow modes so the failure does not depend on scheduling the lookup inside a short cleanup window. Changelog-Fixed: listpays no longer reports failed xpay payments as pending while asynchronous cleanup runs.
darioAnongba
force-pushed
the
fix/xpay-final-failure-status
branch
from
November 10, 2026 13:36
7f56a33 to
b1b304f
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xpaycan return its final failure whilelistpaysstill reportspending, even when all payment parts have failed.payment_give_up()clearspayment->cmdafter replying, but the payment remains inxpay->paymentsuntil outstanding requests and private-layer cleanup finish.attempt_ongoing()currently counts that cleanup-only entry as an active payment. This can leave a caller that checks status after the final RPC error with a stale pending result.Require
payment->cmdinattempt_ongoing(), preserving the existing hash/group match. Unresolved HTLCs still produce pending throughlistpays' existingPAYMENT_PENDINGcheck.The regression pays two deleted invoices between two real nodes and holds both
askrene-remove-layerrequests through an asynchronous RPC hook. It checkslistpaysafter the final xpay errors while cleanup is paused, releases all held requests infinally, waits for the temporary layers to disappear, and checks that both payments remain failed. Empty and repeated releases are also exercised. Both normal and slow modes are covered, without a timing-dependent sleep.Validation
4fc822f94c805edff71572cb12eaea902c3ce3c0with--disable-rust --disable-valgrind --enable-static.assert 'pending' == 'failed'when the original C behavior is restored (rechecked at a539c63).git diff --checkpass.