11# logfowd2
22
33![ Tests and linters] ( https://github.com/soulgarden/logfowd2/actions/workflows/main.yml/badge.svg )
4- [ ![ Version] ( https://img.shields.io/badge/version-0.1 .0-blue.svg )] ( https://github.com/soulgarden/logfowd2 )
5- [ ![ Tests] ( https://img.shields.io/badge/tests-269 %20passing-success.svg )] ( https://github.com/soulgarden/logfowd2 )
4+ [ ![ Version] ( https://img.shields.io/badge/version-0.4 .0-blue.svg )] ( https://github.com/soulgarden/logfowd2 )
5+ [ ![ Tests] ( https://img.shields.io/badge/tests-293 %20passing-success.svg )] ( https://github.com/soulgarden/logfowd2 )
66[ ![ Code Quality] ( https://img.shields.io/badge/linter-zero%20warnings-success.svg )] ( https://github.com/soulgarden/logfowd2 )
77
88** High-performance Kubernetes log forwarding tool built with Rust**
@@ -28,7 +28,7 @@ Logfowd2 is a memory-efficient log forwarding daemon designed for Kubernetes env
2828### Advanced System Optimization
2929- ** MetadataCache System** - High-performance file metadata caching with TTL-based eviction (100ms TTL, LRU)
3030- ** Intelligent Retry Management** - Universal exponential backoff retry mechanism for all async operations
31- - ** Lock Optimization ** - Drop/reacquire pattern minimizes lock contention and improves concurrency
31+ - ** Atomic Event Handling ** - Collect-Then-Send pattern eliminates race conditions in file event processing
3232- ** Event-Driven File Monitoring** - Uses filesystem events for instant rotation detection
3333- ** Historical Log Recovery** - Reads existing log content on startup (no data loss)
3434- ** Symlink Support** - Full support for Kubernetes symlinked log files
@@ -40,7 +40,7 @@ Logfowd2 is a memory-efficient log forwarding daemon designed for Kubernetes env
4040
4141logfowd2 is built with Domain-Driven Design (DDD) principles:
4242- ** Modular design** - Clear separation between domain, infrastructure, and transport layers
43- - ** Comprehensive testing** - 269 tests covering all critical paths
43+ - ** Comprehensive testing** - 293 tests covering all critical paths
4444- ** Type safety** - Leverages Rust's type system for compile-time guarantees
4545- ** Extensible architecture** - Ready for parallel file processing and custom extensions
4646
@@ -81,6 +81,7 @@ Buffer Management State Persist RetryMana
8181#### Watcher (` src/watcher.rs ` )
8282- ** Purpose** : Monitors ` /var/log/pods ` recursively using filesystem events
8383- ** NotifyBridge Integration** : Uses NotifyBridge to prevent filesystem notify callback blocking
84+ - ** Atomic Event Handling** : Collect-Then-Send pattern via ` handle_create_event ` /` handle_remove_event ` eliminates race conditions
8485- ** File Tracking** : Advanced FileTracker with symlink and rapid rotation support, leveraging MetadataCache
8586- ** Metadata Parsing** : Extracts Kubernetes metadata (namespace, pod, container) from log paths
8687- ** Initial Sync** : Processes existing files on startup with position restoration
@@ -140,7 +141,7 @@ Buffer Management State Persist RetryMana
140141- ** Parallel ES Workers** : Concurrent bulk operations with configurable pool sizing
141142- ** Adaptive Batching** : Size and time-based flushing with backpressure awareness
142143- ** Memory Streaming** : Bounded buffer architecture prevents memory growth
143- - ** Advanced Lock Optimization ** : Drop/reacquire pattern minimizes lock contention during I/O operations
144+ - ** Atomic Event Handling ** : Collect-Then-Send pattern eliminates race conditions while maintaining high throughput
144145
145146### Resource Efficiency
146147- ** Ultra-Low Memory Baseline** : 30-50Mi baseline memory usage
@@ -164,7 +165,7 @@ Buffer Management State Persist RetryMana
164165## 🧪 Code Quality & Testing
165166
166167### Test Coverage
167- - ** 263 Comprehensive Tests** : Unit, integration, and edge case coverage
168+ - ** 293 Comprehensive Tests** : Unit, integration, and edge case coverage
168169- ** Domain Testing** : File rotation, symlinks, corrupted files, permission issues
169170- ** Network Testing** : Circuit breaker, retry logic, timeout behavior
170171- ** Memory Testing** : Backpressure, channel overflow, cache eviction
@@ -181,7 +182,7 @@ Buffer Management State Persist RetryMana
181182
182183### Prerequisites
183184- ** Platform** : Linux/Unix only (uses ` std::os::unix ` APIs and Unix signals)
184- - ** Rust Toolchain** : 1.85 + (required for Rust 2024 edition support)
185+ - ** Rust Toolchain** : 1.91 + (required for Rust 2024 edition support)
185186- ** Kubernetes** : 1.14+ with ` /var/log/pods ` access
186187- ** Elasticsearch** : 7.x+ or ZincSearch compatible target
187188
0 commit comments