Skip to content

Orbit mission ID generated with second-precision timestamp causing silent overwrite on concurrent creates #7800

@aashu2006

Description

@aashu2006

User Request

Type: bug
Target: Console Application
Submitted by: @aashu2006
Console Request ID: bf1ff8d1-0dde-46c5-90d7-4ced473c1e3f

Description

What happened:
In pkg/api/handlers/orbit.go:137, mission IDs are generated as "orbit-" + time.Now().Format("20060102150405") with one-second resolution. Two HTTP POST requests arriving within the same wall-clock second receive identical IDs — the second h.missions[m.ID] = &m silently overwrites the first mission.

What I expected:
Mission IDs should use uuid.New() or include nanoseconds to ensure uniqueness under concurrent requests.

Steps to reproduce:

  1. Send two concurrent POST requests to create orbit missions within the same second
  2. Observe the first mission is silently overwritten by the second

This issue was automatically created from the KubeStellar Console.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ai-fix-requestedai-processingAI is currently processing this issuekind/bugCategorizes issue or PR as related to a bug.triage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions