Merged
Conversation
Previously, request_timeout was configured but never enforced, allowing requests to hang indefinitely if upstream servers were slow or unresponsive. Changes: - Add timeout parameter to ProxyService::new() and Listener::bind() - Wrap client.request() with tokio::time::timeout() - Return 504 Gateway Timeout when requests exceed configured duration - Update all tests and doc examples with timeout parameter - Add integration test validating timeout behavior Breaking Change: API now requires Duration parameter Fixes potential DoS via slow upstreams
Implement Hystrix-style circuit breaker for preventing cascading failures. Features: - Three states: Closed, Open, HalfOpen - Configurable failure/success thresholds - Automatic timeout-based recovery - Lock-free atomic operations for performance - Full async/await support - Statistics tracking Implementation: - State transitions based on failure patterns - Closed -> Open after failure_threshold failures - Open -> HalfOpen after timeout duration - HalfOpen -> Closed after success_threshold successes - HalfOpen -> Open immediately on failure Testing: - 5 comprehensive unit tests covering all state transitions - 100% test coverage of state machine logic Note: Module is ready for integration but not yet wired into ProxyService. This allows gradual adoption and keeps this change focused.
Add two runnable examples demonstrating core functionality: basic_proxy.rs: - Minimal proxy setup with httpbin.org upstream - Shows listener creation and graceful shutdown - Full error handling and Ctrl+C handling - Good starting point for new users circuit_breaker_demo.rs: - Demonstrates all circuit breaker state transitions - 5 test scenarios with detailed logging - Statistics output - Educational tool for understanding circuit breaker behavior Run with: cargo run --example basic_proxy cargo run --example circuit_breaker_demo
Add MIT and Apache 2.0 licenses, allowing users to choose the license that works best for their use case. This is standard practice in the Rust ecosystem. Copyright 2024 HueCodes
Add comprehensive contributor guidelines covering: - Development workflow and setup - Code quality standards and testing requirements - Pull request process and commit message format - Architecture guidelines (async/await, error handling, dependencies) - Testing requirements (>80% coverage target) - Areas for contribution (prioritized feature list) These guidelines ensure consistent code quality and make it easier for new contributors to get started.
Add comprehensive CI/CD pipeline with 9 jobs: 1. Test Suite - Multi-platform (Ubuntu + macOS), multi-version (stable + nightly) 2. Code Formatting - Enforce rustfmt 3. Linting - Clippy with warnings as errors 4. Security Audit - cargo audit for vulnerabilities 5. Code Coverage - tarpaulin with Codecov upload 6. Build - Debug and release on multiple platforms 7. Examples Build - Ensure examples compile 8. Dependency Check - Monitor outdated deps 9. Benchmarks - Performance regression tracking (main only) Features: - Cargo caching for faster builds - Fail fast on critical issues - Coverage reporting - Multi-platform validation This ensures code quality and prevents regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.