Skip to content

fix(gameserver): retry room match startup until Runner is ready - #2717

Open
houko wants to merge 2 commits into
mainfrom
fix/host-runner-startup-race
Open

houko wants to merge 2 commits into
mainfrom
fix/host-runner-startup-race

Conversation

@houko

@houko houko commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Problem

Host.Run starts Runner.Run in a goroutine. A room can reach RoomRunning before Runner.Run finishes initialization, so the first lifecycle tick called Runner.Start while it was still a documented no-op. The host then recorded that match and never retried it for the room epoch.

Fix

  • Gate host lifecycle startup on the runner's initialized/running state.
  • Leave the room unattempted while the runner is starting so the next lifecycle tick retries it.
  • Add a deterministic regression test covering the pre-ready tick and the post-ready retry.
  • Document the startup ordering in English and Chinese and update the existing Host design note.

Validation

  • go tool nsgo test ./pkg/online/gameserver -- -race -count=1 (126 passed)
  • go tool nsgo check ./pkg/online/gameserver
  • bun run verify-notes
  • go run ./tools/changelog check

@github-actions github-actions Bot added documentation Improvements or additions to documentation area/agents pkg/online size/S bug Something isn't working labels Dec 1, 2026
@houko
houko force-pushed the fix/host-runner-startup-race branch 2 times, most recently from c4ac6db to 5c0e254 Compare December 1, 2026 02:37
@houko
houko force-pushed the fix/host-runner-startup-race branch from 5c0e254 to 30aa95d Compare December 1, 2026 03:22

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/agents bug Something isn't working documentation Improvements or additions to documentation pkg/online size/S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant