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

Function to check if an ID is occupied by any channel inside the DB. #7216

Merged
merged 1 commit into from
May 22, 2024

Conversation

adi2011
Copy link
Collaborator

@adi2011 adi2011 commented Apr 14, 2024

Some nodes complained about UNIQUE constraint failed upon entering recovery mode. Which means they had closed channels inside the DB which were not loaded hence emergencyrecover tried to stub channels at the same ID. So we need to check for occupied channels inside the DB.

It solves: #7187 #7162 #7183

@adi2011 adi2011 force-pushed the RecoverPlugin branch 4 times, most recently from 0d6a998 to 409ff8d Compare April 15, 2024 06:56
@endothermicdev endothermicdev added this to the v24.05 milestone May 14, 2024
vincenzopalazzo

This comment was marked as off-topic.

Copy link
Collaborator

@vincenzopalazzo vincenzopalazzo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 0d5ba47

CI failure unrelated

===End Flaky Test Report===
=========================== short test summary info ============================
ERROR tests/test_renepay.py::test_limits - ValueError: 
Node errors:
 - lightningd-1: had memleak messages
Global errors:

@endothermicdev
Copy link
Collaborator

I see this one under valgrind. This was on reconnect, so looks suspicious.

FAILED tests/test_misc.py::test_recover_plugin - pyln.client.lightning.RpcError: RPC call failed: method: connect, payload: {'id': '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518', 'host': 'localhost', 'port': 42621}, error: {'code': 402, 'message': 'disconnected during connection'}

@vincenzopalazzo
Copy link
Collaborator

To me the error disconnected during connection is like a bug in the test code (?) but still unrelated to this PR I think.

This can happen when you call disconnect after a connect, but I need to look at the test code before judge, sorry for this early and uncheck feedback

…n the DB as well. Closed channels are not loaded inside the peer struct, hence find_channel_by_id fails when the id is occupied by a closed channel. So we need to create a function to directly check if the ID is occupied or not.
@endothermicdev
Copy link
Collaborator

Rebased now that the renepay test is fixed.

@endothermicdev
Copy link
Collaborator

ACK f8680c0

@endothermicdev endothermicdev merged commit 7fa2e9b into ElementsProject:master May 22, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants