Skip to content

Conversation

@sylvain-pierrot
Copy link
Collaborator

@sylvain-pierrot sylvain-pierrot commented Sep 7, 2025

Summary

This PR introduces significant improvements to the bp-socket system, focusing on installation automation, system resilience under load, and enhanced logging for better observability.

Key Changes

Installation & Automation

  • New make install target: Automated installation of kernel module, daemon, headers, and tools
  • Systemd service integration: Added service files for bp-socket-daemon, ion-dtn, and ud3tn
  • Cloud-init enhancements: Updated provisioning scripts with automatic module loading and service startup
  • Build dependencies: Added clang-format, sparse, and libnl-3-dev to build requirements

System Resilience & Performance

  • Increased queue capacity: Raised send queue limit from 1,000 to 5,000 elements to handle traffic spikes
  • Improved error handling: Enhanced logging with payload sizes and queue metrics for better debugging
  • Thread synchronization fix: Fixed race condition in ion_send_thread loop logic
  • Resource cleanup: Corrected Netlink socket cleanup order to prevent resource leaks

Logging & Observability

  • Structured logging: Improved log messages with consistent formatting and more context
  • Reduced log noise: Moved verbose technical logs to debug level
  • Better error context: Added command IDs and endpoint information to Netlink error messages
  • Performance monitoring: Added queue size warnings for proactive issue detection

🎯 Benefits

  • Easier deployment: One-command installation with make install
  • Better reliability: System handles high load scenarios more gracefully
  • Improved debugging: Enhanced logging provides better visibility into system behavior
  • Production ready: Systemd services enable proper service management

…ce condition

- Add install targets to Makefiles for kernel module and daemon
- Update cloud-init configs with systemd services for bp-socket-daemon, ion-dtn, and ud3tn
- Fix include paths from include/bp_socket.h to bp_socket.h
- Fix race condition in ion_send_thread by changing while loop condition
- Improve logging messages in daemon for better observability
- Add missing dependencies (libnl-3-dev, clang-format, sparse) to build configs
- Add automatic module loading and service startup in provisioning

Signed-off-by: Sylvain Pierrot <[email protected]>
Signed-off-by: Sylvain Pierrot <[email protected]>
- Free libevent events before closing Netlink socket to avoid using closed socket

Signed-off-by: Sylvain Pierrot <[email protected]>
@sylvain-pierrot sylvain-pierrot changed the title feat: add install automation, systemd services and fix send thread ra… System Resilience and Installation Automation Improvements Sep 7, 2025
@sylvain-pierrot sylvain-pierrot merged commit 87fefe6 into main Sep 7, 2025
2 checks passed
@sylvain-pierrot sylvain-pierrot deleted the fix/send-thread branch September 7, 2025 18:16
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