Skip to content

Add Socket Address Uniqueness Validation for Tracker Configuration #255

@josecelano

Description

@josecelano

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

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 environment rather 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)

  1. Domain Model Enhancement (2-3 hours) - includes unit tests
  2. Validation Logic (3-4 hours) - includes unit and integration tests
  3. Error Messages (1-2 hours) - includes formatting tests
  4. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions