{
  "id": "go/grpc-dial-deprecated-withblock",
  "signature": "grpc: WithBlock is deprecated and will be removed in a future release",
  "signature_zh": "grpc：WithBlock 已弃用，将在未来版本中移除",
  "regex": "grpc:\\ WithBlock\\ is\\ deprecated\\ and\\ will\\ be\\ removed\\ in\\ a\\ future\\ release",
  "domain": "go",
  "category": "module_error",
  "subcategory": null,
  "root_cause": "grpc.Dial with grpc.WithBlock() blocks until the connection is ready; the API is deprecated in favor of grpc.NewClient which does not block.",
  "root_cause_type": "generic",
  "root_cause_zh": "使用 grpc.WithBlock() 的 grpc.Dial 会阻塞直到连接就绪；该 API 已弃用，推荐使用不阻塞的 grpc.NewClient。",
  "versions": [
    {
      "version": "google.golang.org/grpc 1.63+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Does not fix the underlying behavior change; WithBlock will be removed and the build will break.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "grpc.NewClient rejects WithBlock and returns an error at construction time.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "Use grpc.NewClient and trigger connection lazily:\nconn, err := grpc.NewClient(target, opts...)\nif err != nil { return err }\n// force a connection when needed:\nconn.Connect()\nconn.WaitForStateChange(ctx, connectivity.Idle)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "If you truly need blocking connect semantics, use a health check RPC:\nclient := pb.NewHealthClient(conn)\n_, err = client.Check(ctx, &pb.HealthCheckRequest{})",
      "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.86,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-07-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}