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

Improve listpeers handling diagnostics #215

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

ksedgwic
Copy link
Collaborator

@ksedgwic ksedgwic commented Jun 15, 2024

This PR addresses (but does not fix) #214

We don't have enough information about the nature of the unexpected handling error:

  • Improve the ConstructedListpeers handling diagnostics.
  • Hopefully this pattern will prove useful in future debugging improvements.

@ksedgwic ksedgwic mentioned this pull request Jun 15, 2024
@ksedgwic ksedgwic force-pushed the 2024-06-fix-214 branch 2 times, most recently from 0404033 to 009f597 Compare June 15, 2024 23:20
@ksedgwic ksedgwic changed the title Fix "unexpected listpeers" Improve listpeers handling diagnostics Jun 17, 2024
@ksedgwic ksedgwic marked this pull request as ready for review June 17, 2024 00:28
@ksedgwic ksedgwic mentioned this pull request Jun 17, 2024
8 tasks
Copy link
Contributor

@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.

wondering if this is due some channels that are null?

otherwise LGTM

os << "(ConstructedListpeer): {"
<< "connected: " << o.connected
<< ", channels: ";
Util::stream_elements(os, o.channels);
Copy link
Contributor

Choose a reason for hiding this comment

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

listpeers should not have the channels anymore, so we may want drop it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So this is a ConstructedListpeer which is a "compatibility struct" invented by me to make the conversion easier. Basically I convert the return from listpeerchannels into what the old listpeers output used to look like, so the consumers do not need to invert their loops and logic.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

wondering if this is due some channels that are null?

I think so too, specifically I'm guessing that they have channels which don't have status fields. The code look for status w/o checking to see if the field exists.

Based on prior experience these poorly formed channels might exist early in their lifecycle, before they are confirmed.

I expected to see the errors during initial channel creation and didn't in my most recent run, so there is some chance I don't understand the mechanism completetly though.

Copy link
Contributor

Choose a reason for hiding this comment

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

Mh these are good point, but the status should always exist otherwise there is a bug in cln, I will try to look inside the codebase in this week

Hopefully this pattern will prove useful in future debugging
improvements.
Copy link
Contributor

@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.

LGTM

@ksedgwic ksedgwic merged commit 56f405f into ZmnSCPxj:master Jul 16, 2024
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.

2 participants