-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Overview
Add validation to prevent invalid tracker configurations where multiple services attempt to bind to the same socket address (IP + Port + Protocol). The deployer currently accepts configurations that cause runtime failures when services cannot bind to already-occupied ports.
Problem: Users can create environment configurations with port conflicts that pass validation during create environment but fail at runtime during run, causing tracker container restart loops with unclear error messages.
Solution: Implement socket address uniqueness validation at configuration load time with clear, actionable error messages.
Related Documentation
- docs/external-issues/tracker/udp-tcp-port-sharing-allowed.md
- Test configuration:
envs/bug-test-actual-conflict.json - docs/contributing/error-handling.md
Goals
- Prevent same-protocol port conflicts (e.g., two HTTP trackers on same IP:Port)
- Prevent TCP protocol conflicts (e.g., HTTP tracker + API on same port)
- Allow cross-protocol port sharing (e.g., UDP + HTTP on same port) with clear understanding
- Provide clear, actionable error messages when validation fails
- Fail fast during
create environmentrather than at runtime
Architecture Requirements
DDD Layer: Domain
Module Path: src/domain/tracker/
Pattern: Value Object with validation logic
Implementation
See detailed implementation plan in:
docs/issues/add-socket-address-uniqueness-validation.md
Estimated effort: ~8 hours across 4 phases (TDD approach - tests integrated with implementation)
- Domain Model Enhancement (2-3 hours) - includes unit tests
- Validation Logic (3-4 hours) - includes unit and integration tests
- Error Messages (1-2 hours) - includes formatting tests
- Documentation (1 hour)
Acceptance Criteria
- Users cannot create environment with same-protocol port conflicts
- Clear error messages with specific fix instructions
- Cross-protocol port sharing works (UDP + TCP on same port)
- Unit tests for validation logic using TDD approach
- Integration tests reproducing the original bug
- Documentation updated with validation rules