Conversation
⏺ Done. Coroutine stack size is now configurable via SEQ_STACK_SIZE environment variable: # Default: 1MB ./my-program # Custom: 2MB SEQ_STACK_SIZE=2097152 ./my-program Simple change, good principle. Also fixed the comment in tcp_test.rs which said "1MB" but was actually 128KB (0x20000).
PR Review: Stack Size ConfigurationSummaryThis PR introduces configurable coroutine stack size via the SEQ_STACK_SIZE environment variable, with a sensible default of 1MB. The change is well-implemented and follows good software engineering principles. Strengths
Suggestions for Improvement1. Add Validation for Stack Size (scheduler.rs:68-71) The current implementation silently falls back to default for invalid values. Consider adding validation with warnings for values that are too small or too large. Users should know if their configuration is being ignored. 2. Add Test Coverage No tests verify the new environment variable behavior. Consider adding tests for valid values, invalid values, and boundary conditions. Note: The Once::call_once pattern makes testing difficult - consider extracting configuration logic into a testable function. 3. Documentation Enhancement Add to the comments what happens with invalid values. 4. Consistency Check The tcp_test.rs now hardcodes 0x100000. Consider using the DEFAULT_STACK_SIZE constant for consistency, or document why it needs a specific hardcoded value. Security AssessmentNo security concerns. Environment variable parsing is safe with no shell injection risk and graceful handling of invalid input. Performance ConsiderationsNo performance impact. Configuration happens once during initialization with negligible one-time cost. Potential Issues
Test CoverageMissing test coverage for the new functionality. RecommendationAPPROVE with suggestions. This is a solid change that improves operational flexibility. The core implementation is sound and the default behavior is unchanged, making this a safe, backward-compatible enhancement. Nice Touches
Great work! |
⏺ All PR feedback addressed: 1. Validation warnings - Now prints to stderr when SEQ_STACK_SIZE is zero or invalid 2. Test coverage - Added 4 tests for parse_stack_size(): valid values, None, zero, and invalid inputs 3. Refactored for testability - Extracted parsing logic into a separate function The tcp_test.rs constant suggestion I'm skipping - it's a standalone test that explicitly tests May directly, and keeping the literal 0x100000 with "1MB" comment is clearer for that purpose.
Code Review for PR #71: Stack Size ConfigurationSummaryThis PR adds runtime configuration for coroutine stack size via the SEQ_STACK_SIZE environment variable. The implementation is clean, well-tested, and addresses a real need for users hitting stack overflow in deeply nested calls. Strengths
Code Quality & Best PracticesGood:
Potential IssuesNone found! The implementation handles all edge cases appropriately:
Performance ConsiderationsExcellent:
Security ConcernsLow Risk:
Optional Consideration: You might want to add an upper bound check to provide a better error message before May panics with ExceedsMaximumSize. However, this is optional since the comment already mentions May internal maximum and users tuning this are likely advanced users. Test CoverageExcellent coverage. All paths are tested: valid positive integers, boundary cases, None/missing env var, zero, non-numeric strings, negative numbers, empty strings, and floating-point numbers. Note: Tests that print warnings to stderr will show output during cargo test. This is fine and expected. DocumentationComprehensive:
Final VerdictApproved! This is a well-implemented, properly tested feature that adds useful configurability without complexity. The code follows Rust best practices, handles edge cases gracefully, and includes excellent documentation. Recommendation: Merge as-is. Checklist
Great work! |
Pull Request Review: Stack Size ConfigurationOverviewThis PR adds runtime configurability for coroutine stack sizes via the ✅ Strengths1. Excellent Code Quality
2. Comprehensive Test Coverage ⭐
3. Documentation
4. Bug Fix
🔍 Code Review FindingsMinor Issues1. Consider
|
| Category | Rating | Notes |
|---|---|---|
| Code Quality | ⭐⭐⭐⭐⭐ | Clean, idiomatic Rust |
| Test Coverage | ⭐⭐⭐⭐⭐ | Comprehensive edge case testing |
| Documentation | ⭐⭐⭐⭐ | Good, could add timing note |
| Error Handling | ⭐⭐⭐⭐⭐ | Proper warnings, graceful fallbacks |
| Performance | ⭐⭐⭐⭐⭐ | Minimal overhead (read once) |
| Security | ⭐⭐⭐⭐⭐ | No concerns |
📋 Recommendations
Must Address
None - the PR is ready to merge as-is! ✅
Should Consider
- Add upper bound validation for Mays 64MB limit (prevents panic with better error message)
- Document that
SEQ_STACK_SIZEmust be set before first scheduler initialization
Nice to Have
- Consider adding a test that validates the stack size is actually applied (integration test)
- Add example usage in
examples/directory demonstrating when to increase stack size
🎉 Summary
This is a high-quality PR that adds useful functionality with excellent test coverage and documentation. The code follows Rust best practices and integrates cleanly with the existing codebase. The bug fix in tcp_test.rs is a nice bonus.
Recommendation: ✅ APPROVE with minor suggestions
The suggestions above are enhancements, not blockers. The PR is ready to merge in its current state.
Review conducted following repository conventions and Rust best practices
⏺ Done. Coroutine stack size is now configurable via SEQ_STACK_SIZE environment variable:
Default: 1MB
./my-program
Custom: 2MB
SEQ_STACK_SIZE=2097152 ./my-program
Simple change, good principle. Also fixed the comment in tcp_test.rs which said "1MB" but was actually 128KB (0x20000).