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

[client] Limit P2P attempts and restart on specific events #2657

Merged
merged 14 commits into from
Oct 8, 2024

Conversation

lixmal
Copy link
Contributor

@lixmal lixmal commented Sep 27, 2024

Describe your changes

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

@pappz pappz self-requested a review October 1, 2024 08:26
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it make no sense to move this file into a separate structure? I do not see any dependency from the conn that is not exchangeable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sonar will complain :)

Copy link
Contributor

Choose a reason for hiding this comment

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

for what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That the file is too large

Copy link
Contributor

Choose a reason for hiding this comment

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

I can not follow you. If you move everything from conn_monitor.go to monitor.go and in it create a

type ConnMonitor struct {
}

Then we can get a better separated code structure that is better testable by unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have moved it to a separate struct. But not its own package yet because that requires more refactoring on the other components

Copy link
Contributor

Choose a reason for hiding this comment

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

This looks nice! I will review it again.

client/internal/peer/conn_monitor.go Outdated Show resolved Hide resolved
client/internal/peer/conn_monitor.go Outdated Show resolved Hide resolved
@lixmal lixmal changed the title Limit P2P attempts and restart on specific events [client] Limit P2P attempts and restart on specific events Oct 1, 2024
Copy link

sonarcloud bot commented Oct 4, 2024

@lixmal lixmal merged commit 44e8107 into main Oct 8, 2024
21 checks passed
@lixmal lixmal deleted the limit-p2p-attempts branch October 8, 2024 09:21
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