{
  "id": "go/select-random-case-when-multiple-ready",
  "signature": "bug: select picks random case, message reordering observed",
  "signature_zh": "缺陷: select 随机选择 case，观察到消息乱序",
  "regex": "bug:\\ select\\ picks\\ random\\ case,\\ message\\ reordering\\ observed",
  "domain": "go",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "When multiple select cases are ready, Go picks one pseudo-randomly. Code assuming deterministic ordering or priority breaks.",
  "root_cause_type": "generic",
  "root_cause_zh": "当多个 select case 同时就绪时，Go 伪随机选择一个。假设确定性顺序或优先级的代码会出错。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Go does not honor case order for priority; selection is random.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Doesn't affect select semantics and adds latency.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "select {\ncase v := <-highPriority:\n    handle(v)\ndefault:\n    select {\n    case v := <-highPriority:\n        handle(v)\n    case v := <-lowPriority:\n        handle(v)\n    }\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "type msg struct { prio int; body any }\n// single channel; consumer sorts or dispatches by prio",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}