Skip to content

Conversation

bomanaps
Copy link
Contributor

@bomanaps bomanaps commented Sep 8, 2025

What was wrong?

Issue #

How was it fixed?

Comprehensive Health Metrics: Implemented ConnectionHealth dataclass with latency tracking, success rates, bandwidth monitoring, and weighted health scoring.

Proactive Monitoring Service: Built ConnectionHealthMonitor with periodic health checks, real-time ping measurements, and automatic unhealthy connection replacement.

Health-Aware Load Balancing: Added four intelligent connection selection strategies, including health_based and latency_based, for optimal traffic routing.

API Consistency Fix: Extended new_host() to accept connection_config, resolving previous API inconsistency while maintaining full backward compatibility.
Summary of approach.

To-Do

  • Clean up commit history
  • Add or update documentation related to these changes
  • Add entry to the release notes

Cute Animal Picture

put a cute animal picture link inside the parentheses

@bomanaps
Copy link
Contributor Author

bomanaps commented Sep 9, 2025

Hi @seetadev this ci keeps failing but has nothing to do with the implementation i made, and also i had to create a new pr because there was a lot of changes that affected me when i git pulled

@bomanaps
Copy link
Contributor Author

bomanaps commented Sep 9, 2025

Hello @sumanjeet0012 @lla-dane @sukhman-sukh please can i get a review on this, thanks

@sumanjeet0012
Copy link
Contributor

@bomanaps Could you please share the link to the specification file or a reference to this feature in other libp2p implementations? It would be easier for me to understand what exactly we want to implement through this PR.

@bomanaps
Copy link
Contributor Author

bomanaps commented Sep 9, 2025

@bomanaps Could you please share the link to the specification file or a reference to this feature in other libp2p implementations? It would be easier for me to understand what exactly we want to implement through this PR.

#717 (comment)

@bomanaps
Copy link
Contributor Author

bomanaps commented Sep 9, 2025

@acul71 i had to create a new pr because there was a lot of changes that affected me when i git pulled

@bomanaps
Copy link
Contributor Author

bomanaps commented Sep 9, 2025

Hello @acul71 @sumanjeet0012 @lla-dane @sukhman-sukh please can i get a review on this, thanks

@sumanjeet0012
Copy link
Contributor

@bomanaps This is a fairly substantial PR, and there have already been extensive discussions surrounding it. I’ll need some additional time to review it thoroughly. I’m planning to go through it over the weekend.

Copy link
Contributor

@sumanjeet0012 sumanjeet0012 left a comment

Choose a reason for hiding this comment

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

@bomanaps Would you be able to share a basic screencast demonstrating the execution of health_monitoring_example.py? I'm currently facing some issues with dependency installation and haven't been able to run the example locally.

@acul71
Copy link
Contributor

acul71 commented Sep 15, 2025

@bomanaps
Good work. Make a demo (something others members can see and appreciate health monitor new module features, could be as simple as a simple video showing examples and talking over. You could also do this online during the py-libp2p meeting)
See if you can address @sumanjeet0012 suggestions

🎉 Conclusion
The health monitoring branch has successfully implemented virtually ALL suggestions from the enhancement document, plus additional improvements!
The implementation is production-ready and provides:
✅ Sophisticated connection health tracking
✅ Proactive monitoring and automatic recovery
✅ Health-aware load balancing
✅ Comprehensive metrics and reporting
✅ Clean API integration
✅ Full documentation and examples
This represents a significant enhancement to Python libp2p's connection management capabilities, bringing it in line with the Go and JavaScript reference implementations as originally suggested.

@bomanaps
Copy link
Contributor Author

Hello @acul71 @sumanjeet0012 @seetadev am done addressing this

Screen.Recording.2025-09-17.at.07.53.50.mov

@acul71
Copy link
Contributor

acul71 commented Sep 17, 2025

Hello @acul71 @sumanjeet0012 @seetadev am done addressing this

Screen.Recording.2025-09-17.at.07.53.50.mov

Hey. Good try, but It's difficult to understands what's going on, without audio that comments over or subs or another format like presentation with slides

Isn't there something like a panel with real time info or something like that

fictional picture:
image

Kidding, just something more clear at a glance

@acul71
Copy link
Contributor

acul71 commented Sep 17, 2025

@bomanaps Are the failing test related or not ? do they fail on your local box with make pr ?

@bomanaps
Copy link
Contributor Author

@seetadev merged something that caused ci to fail, this checked out d2c91f1

@acul71
Copy link
Contributor

acul71 commented Sep 17, 2025

@seetadev merged something that caused ci to fail, this checked out d2c91f1

Maybe they randomly failed maybe are related. In my local linux box everything work

@bomanaps
Copy link
Contributor Author

@seetadev merged something that caused ci to fail, this checked out d2c91f1

Maybe they randomly failed maybe are related. In my local linux box everything work

If we can re run the ci that will be good the logs iis not from my end make pr passes too, but the ci fail is showing test_provide_and_find_providers is checking that envelope_a

@bomanaps
Copy link
Contributor Author

@acul71 @sumanjeet0012

@acul71
Copy link
Contributor

acul71 commented Sep 20, 2025

@sumanjeet0012 LGTM see if you dig it.

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.

4 participants