{
  "id": "go/grpc-aborted-concurrent-modification",
  "signature": "rpc error: code = Aborted desc = concurrent modification detected",
  "signature_zh": "rpc 错误：code = Aborted desc = 检测到并发修改",
  "regex": "rpc\\ error:\\ code\\ =\\ Aborted\\ desc\\ =\\ concurrent\\ modification\\ detected",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The server detected a concurrent modification conflict, often due to optimistic locking or transaction conflicts.",
  "root_cause_type": "generic",
  "root_cause_zh": "服务器检测到并发修改冲突，通常由于乐观锁或事务冲突。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Immediate retries can exacerbate contention and lead to more conflicts.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Disabling concurrency control can lead to data corruption and is not acceptable.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "for i := 0; i < 5; i++ {\n    resp, err := client.YourMethod(ctx, req)\n    if err == nil { break }\n    if status.Code(err) == codes.Aborted {\n        time.Sleep(time.Duration(1<<i) * time.Second)\n        continue\n    }\n    return err\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "// Include a version field in your request and have the server check it.\n// On conflict, fetch the latest version and retry.",
      "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": "2025-03-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}