Skip to content

[BUG] Only 8 characters of UUID used for container names, creating collision risk #120

@Cute0110

Description

@Cute0110

Project

term-challenge

Description

Only 8 characters of a UUID are used for container names, creating collision risk in high-throughput scenarios due to the birthday paradox.

Error Observation

With only ~4 billion possible names (32 bits), there's a 50% collision probability at ~77,000 containers.

Error Message

Debug Logs

System Information

Version: 0.1.0

## Operating System
  OS: Ubuntu 24.04.3 LTS
  Kernel: 6.8.0-79-generic
  Arch: x86_64

## Hardware
  CPU: AMD Ryzen 9 5950X 16-Core Processor (4 cores)
  RAM: 11 GB

## Build Environment
  Rust: rustc 1.92.0 (ded5c06cf 2025-12-08)
  Target: x86_64

Screenshots

No response

Steps to Reproduce

  1. Open src/container/docker.rs line 220:
let container_name = format!("term-challenge-{}", &uuid::Uuid::new_v4().to_string()[..8]);
  1. Also in src/container/backend.rs line 1093

Expected Behavior

Use at least 12-16 characters or the full UUID.

Actual Behavior

Container creation fails with duplicate name error when collision occurs.

Additional Context

UUID v4 has 122 bits of entropy, but truncating to 8 hex characters gives only ~32 bits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions