[{"data":1,"prerenderedAt":1685},["ShallowReactive",2],{"content-query-GPSqESo6i0":3},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"url":11,"tags":12,"en-title":17,"body":18,"_type":1679,"_id":1680,"_source":1681,"_file":1682,"_stem":1683,"_extension":1684},"/blog/2026-06-05-retry-policy-basics","blog",false,"","把重试机制做稳：退避、抖动和幂等","摘要：重试是工程系统里最常见的容错手段，但也是最容易被滥用的手段。只会“再试一次”通常不够，真正稳定的重试需要区分错误类型、控制节奏、避免重复副作用。本文从退避、抖动和幂等三个角度，整理一套更可靠的重试思路。","2026-06-05 12:00:00",null,[13,14,15,16],"后端","可靠性","工程","Node.js","Make Retries Reliable with Backoff Jitter and Idempotency",{"type":19,"children":20,"toc":1664},"root",[21,29,34,38,52,57,62,87,92,97,102,108,136,141,169,174,187,192,197,202,249,254,259,316,321,326,331,336,341,373,378,432,437,442,447,452,470,475,480,504,509,514,519,537,1468,1473,1491,1504,1509,1514,1519,1547,1552,1557,1580,1585,1590,1595,1633,1638,1643,1648,1653,1658],{"type":22,"tag":23,"props":24,"children":26},"element","h1",{"id":25},"把重试机制做稳退避抖动和幂等",[27],{"type":28,"value":8},"text",{"type":22,"tag":30,"props":31,"children":32},"p",{},[33],{"type":28,"value":9},{"type":22,"tag":35,"props":36,"children":37},"hr",{},[],{"type":22,"tag":39,"props":40,"children":42},"h2",{"id":41},"为什么重试不能只写一个-while",[43,45],{"type":28,"value":44},"为什么重试不能只写一个 ",{"type":22,"tag":46,"props":47,"children":49},"code",{"className":48},[],[50],{"type":28,"value":51},"while",{"type":22,"tag":30,"props":53,"children":54},{},[55],{"type":28,"value":56},"很多系统在遇到瞬时故障时，第一反应都是重试。数据库短暂抖动、上游超时、网络丢包、冷启动阶段的连接失败，确实都可能通过重试恢复。",{"type":22,"tag":30,"props":58,"children":59},{},[60],{"type":28,"value":61},"问题在于，简单粗暴的重试会把故障放大：",{"type":22,"tag":63,"props":64,"children":65},"ul",{},[66,72,77,82],{"type":22,"tag":67,"props":68,"children":69},"li",{},[70],{"type":28,"value":71},"所有请求同时重试，会把上游打得更满",{"type":22,"tag":67,"props":73,"children":74},{},[75],{"type":28,"value":76},"没有等待时间，会在短时间内疯狂重放",{"type":22,"tag":67,"props":78,"children":79},{},[80],{"type":28,"value":81},"没有终止条件，会把永久错误当成临时错误",{"type":22,"tag":67,"props":83,"children":84},{},[85],{"type":28,"value":86},"没有幂等保护，会重复扣款、重复发信、重复写库",{"type":22,"tag":30,"props":88,"children":89},{},[90],{"type":28,"value":91},"所以，重试不是“失败后的默认动作”，而是一个需要设计的策略。",{"type":22,"tag":39,"props":93,"children":95},{"id":94},"先分清能不能重试",[96],{"type":28,"value":94},{"type":22,"tag":30,"props":98,"children":99},{},[100],{"type":28,"value":101},"不是所有错误都适合重试。判断之前，先把错误分成两类：",{"type":22,"tag":103,"props":104,"children":106},"h3",{"id":105},"适合重试的临时错误",[107],{"type":28,"value":105},{"type":22,"tag":63,"props":109,"children":110},{},[111,116,121,126,131],{"type":22,"tag":67,"props":112,"children":113},{},[114],{"type":28,"value":115},"连接超时",{"type":22,"tag":67,"props":117,"children":118},{},[119],{"type":28,"value":120},"读写超时",{"type":22,"tag":67,"props":122,"children":123},{},[124],{"type":28,"value":125},"503、502 之类的短暂服务不可用",{"type":22,"tag":67,"props":127,"children":128},{},[129],{"type":28,"value":130},"DNS 抖动或短暂网络中断",{"type":22,"tag":67,"props":132,"children":133},{},[134],{"type":28,"value":135},"下游限流，但系统允许稍后再试",{"type":22,"tag":103,"props":137,"children":139},{"id":138},"不适合重试的永久错误",[140],{"type":28,"value":138},{"type":22,"tag":63,"props":142,"children":143},{},[144,149,154,159,164],{"type":22,"tag":67,"props":145,"children":146},{},[147],{"type":28,"value":148},"参数校验失败",{"type":22,"tag":67,"props":150,"children":151},{},[152],{"type":28,"value":153},"鉴权失败",{"type":22,"tag":67,"props":155,"children":156},{},[157],{"type":28,"value":158},"资源不存在",{"type":22,"tag":67,"props":160,"children":161},{},[162],{"type":28,"value":163},"逻辑错误",{"type":22,"tag":67,"props":165,"children":166},{},[167],{"type":28,"value":168},"已经确定不会成功的业务请求",{"type":22,"tag":30,"props":170,"children":171},{},[172],{"type":28,"value":173},"如果把永久错误也纳入重试，只会浪费时间，还会掩盖真正的问题。",{"type":22,"tag":30,"props":175,"children":176},{},[177,179,185],{"type":28,"value":178},"一个实用原则是：",{"type":22,"tag":180,"props":181,"children":182},"strong",{},[183],{"type":28,"value":184},"只对“稍后有可能成功”的失败重试",{"type":28,"value":186},"。",{"type":22,"tag":39,"props":188,"children":190},{"id":189},"退避比立即重试更重要",[191],{"type":28,"value":189},{"type":22,"tag":30,"props":193,"children":194},{},[195],{"type":28,"value":196},"最朴素的重试是失败后立刻再来一次。这个做法在低并发环境下看似有效，但一旦大面积故障发生，就会把所有客户端的压力瞬间推到同一个时间点。",{"type":22,"tag":30,"props":198,"children":199},{},[200],{"type":28,"value":201},"更稳的方式是指数退避：",{"type":22,"tag":203,"props":204,"children":207},"pre",{"className":205,"code":206,"language":28,"meta":7,"style":7},"language-text shiki shiki-themes vitesse-light vitesse-dark monokai","第一次失败后等 200ms\n第二次失败后等 400ms\n第三次失败后等 800ms\n第四次失败后等 1600ms\n",[208],{"type":22,"tag":46,"props":209,"children":210},{"__ignoreMap":7},[211,222,231,240],{"type":22,"tag":212,"props":213,"children":216},"span",{"class":214,"line":215},"line",1,[217],{"type":22,"tag":212,"props":218,"children":219},{},[220],{"type":28,"value":221},"第一次失败后等 200ms\n",{"type":22,"tag":212,"props":223,"children":225},{"class":214,"line":224},2,[226],{"type":22,"tag":212,"props":227,"children":228},{},[229],{"type":28,"value":230},"第二次失败后等 400ms\n",{"type":22,"tag":212,"props":232,"children":234},{"class":214,"line":233},3,[235],{"type":22,"tag":212,"props":236,"children":237},{},[238],{"type":28,"value":239},"第三次失败后等 800ms\n",{"type":22,"tag":212,"props":241,"children":243},{"class":214,"line":242},4,[244],{"type":22,"tag":212,"props":245,"children":246},{},[247],{"type":28,"value":248},"第四次失败后等 1600ms\n",{"type":22,"tag":30,"props":250,"children":251},{},[252],{"type":28,"value":253},"它的作用不是“等久一点”，而是主动给下游恢复时间。",{"type":22,"tag":30,"props":255,"children":256},{},[257],{"type":28,"value":258},"常见做法是：",{"type":22,"tag":203,"props":260,"children":264},{"className":261,"code":262,"language":263,"meta":7,"style":7},"language-ts shiki shiki-themes vitesse-light vitesse-dark monokai","const delay = base * 2 ** attempt\n","ts",[265],{"type":22,"tag":46,"props":266,"children":267},{"__ignoreMap":7},[268],{"type":22,"tag":212,"props":269,"children":270},{"class":214,"line":215},[271,277,283,289,294,300,306,311],{"type":22,"tag":212,"props":272,"children":274},{"style":273},"--shiki-default:#AB5959;--shiki-default-font-style:inherit;--shiki-dark:#CB7676;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[275],{"type":28,"value":276},"const",{"type":22,"tag":212,"props":278,"children":280},{"style":279},"--shiki-default:#B07D48;--shiki-dark:#BD976A;--shiki-sepia:#F8F8F2",[281],{"type":28,"value":282}," delay",{"type":22,"tag":212,"props":284,"children":286},{"style":285},"--shiki-default:#999999;--shiki-dark:#666666;--shiki-sepia:#F92672",[287],{"type":28,"value":288}," =",{"type":22,"tag":212,"props":290,"children":291},{"style":279},[292],{"type":28,"value":293}," base",{"type":22,"tag":212,"props":295,"children":297},{"style":296},"--shiki-default:#AB5959;--shiki-dark:#CB7676;--shiki-sepia:#F92672",[298],{"type":28,"value":299}," *",{"type":22,"tag":212,"props":301,"children":303},{"style":302},"--shiki-default:#2F798A;--shiki-dark:#4C9A91;--shiki-sepia:#AE81FF",[304],{"type":28,"value":305}," 2",{"type":22,"tag":212,"props":307,"children":308},{"style":296},[309],{"type":28,"value":310}," **",{"type":22,"tag":212,"props":312,"children":313},{"style":279},[314],{"type":28,"value":315}," attempt\n",{"type":22,"tag":30,"props":317,"children":318},{},[319],{"type":28,"value":320},"但纯指数退避还有一个问题：所有客户端还是可能在同一时刻醒来。于是就需要抖动。",{"type":22,"tag":39,"props":322,"children":324},{"id":323},"抖动能避免同步风暴",[325],{"type":28,"value":323},{"type":22,"tag":30,"props":327,"children":328},{},[329],{"type":28,"value":330},"如果一批请求在同一时刻失败，它们在相同的退避策略下也会在相同时间点重试。这会形成新的尖峰。",{"type":22,"tag":30,"props":332,"children":333},{},[334],{"type":28,"value":335},"抖动的作用，就是给每次等待时间加一点随机扰动，让重试分散开。",{"type":22,"tag":30,"props":337,"children":338},{},[339],{"type":28,"value":340},"常见方式有三种：",{"type":22,"tag":63,"props":342,"children":343},{},[344,355,368],{"type":22,"tag":67,"props":345,"children":346},{},[347,349],{"type":28,"value":348},"full jitter：每次随机等待 ",{"type":22,"tag":46,"props":350,"children":352},{"className":351},[],[353],{"type":28,"value":354},"0 ~ backoff",{"type":22,"tag":67,"props":356,"children":357},{},[358,360,366],{"type":28,"value":359},"equal jitter：在 ",{"type":22,"tag":46,"props":361,"children":363},{"className":362},[],[364],{"type":28,"value":365},"backoff / 2 ~ backoff",{"type":28,"value":367}," 之间随机",{"type":22,"tag":67,"props":369,"children":370},{},[371],{"type":28,"value":372},"decorrelated jitter：下一次等待时间参考上一次，但保留随机性",{"type":22,"tag":30,"props":374,"children":375},{},[376],{"type":28,"value":377},"对于大多数业务系统，full jitter 已经足够实用：",{"type":22,"tag":203,"props":379,"children":381},{"className":261,"code":380,"language":263,"meta":7,"style":7},"const wait = Math.random() * backoff\n",[382],{"type":22,"tag":46,"props":383,"children":384},{"__ignoreMap":7},[385],{"type":22,"tag":212,"props":386,"children":387},{"class":214,"line":215},[388,392,397,401,406,412,418,423,427],{"type":22,"tag":212,"props":389,"children":390},{"style":273},[391],{"type":28,"value":276},{"type":22,"tag":212,"props":393,"children":394},{"style":279},[395],{"type":28,"value":396}," wait",{"type":22,"tag":212,"props":398,"children":399},{"style":285},[400],{"type":28,"value":288},{"type":22,"tag":212,"props":402,"children":403},{"style":279},[404],{"type":28,"value":405}," Math",{"type":22,"tag":212,"props":407,"children":409},{"style":408},"--shiki-default:#999999;--shiki-dark:#666666;--shiki-sepia:#F8F8F2",[410],{"type":28,"value":411},".",{"type":22,"tag":212,"props":413,"children":415},{"style":414},"--shiki-default:#59873A;--shiki-dark:#80A665;--shiki-sepia:#A6E22E",[416],{"type":28,"value":417},"random",{"type":22,"tag":212,"props":419,"children":420},{"style":408},[421],{"type":28,"value":422},"()",{"type":22,"tag":212,"props":424,"children":425},{"style":296},[426],{"type":28,"value":299},{"type":22,"tag":212,"props":428,"children":429},{"style":279},[430],{"type":28,"value":431}," backoff\n",{"type":22,"tag":30,"props":433,"children":434},{},[435],{"type":28,"value":436},"它简单，效果也足够明显。",{"type":22,"tag":39,"props":438,"children":440},{"id":439},"幂等性是重试的底座",[441],{"type":28,"value":439},{"type":22,"tag":30,"props":443,"children":444},{},[445],{"type":28,"value":446},"重试真正危险的地方，不是“多试了一次”，而是“多执行了一次副作用”。",{"type":22,"tag":30,"props":448,"children":449},{},[450],{"type":28,"value":451},"比如：",{"type":22,"tag":63,"props":453,"children":454},{},[455,460,465],{"type":22,"tag":67,"props":456,"children":457},{},[458],{"type":28,"value":459},"下单接口重试后创建了两笔订单",{"type":22,"tag":67,"props":461,"children":462},{},[463],{"type":28,"value":464},"支付接口重试后扣了两次钱",{"type":22,"tag":67,"props":466,"children":467},{},[468],{"type":28,"value":469},"发送消息接口重试后发了两条",{"type":22,"tag":30,"props":471,"children":472},{},[473],{"type":28,"value":474},"要避免这类问题，接口设计必须考虑幂等性。",{"type":22,"tag":30,"props":476,"children":477},{},[478],{"type":28,"value":479},"常见做法有几种：",{"type":22,"tag":481,"props":482,"children":483},"ol",{},[484,489,494,499],{"type":22,"tag":67,"props":485,"children":486},{},[487],{"type":28,"value":488},"让客户端带上幂等键",{"type":22,"tag":67,"props":490,"children":491},{},[492],{"type":28,"value":493},"服务端把幂等键和结果缓存起来",{"type":22,"tag":67,"props":495,"children":496},{},[497],{"type":28,"value":498},"数据库层增加唯一约束",{"type":22,"tag":67,"props":500,"children":501},{},[502],{"type":28,"value":503},"写入流程先查后写，或者直接用幂等写法",{"type":22,"tag":30,"props":505,"children":506},{},[507],{"type":28,"value":508},"如果一个操作天然不能幂等，那它就不适合简单重试。要么改协议，要么拆分流程，把“触发动作”和“最终落库”分开。",{"type":22,"tag":39,"props":510,"children":512},{"id":511},"一个可复用的重试实现",[513],{"type":28,"value":511},{"type":22,"tag":30,"props":515,"children":516},{},[517],{"type":28,"value":518},"下面是一版比较克制的 TypeScript 重试封装。它做了三件事：",{"type":22,"tag":63,"props":520,"children":521},{},[522,527,532],{"type":22,"tag":67,"props":523,"children":524},{},[525],{"type":28,"value":526},"限制最大尝试次数",{"type":22,"tag":67,"props":528,"children":529},{},[530],{"type":28,"value":531},"使用指数退避加抖动",{"type":22,"tag":67,"props":533,"children":534},{},[535],{"type":28,"value":536},"只重试指定错误",{"type":22,"tag":203,"props":538,"children":540},{"className":261,"code":539,"language":263,"meta":7,"style":7},"type RetryOptions = {\n  retries: number\n  baseDelayMs?: number\n  shouldRetry?: (error: unknown) => boolean\n}\n\nconst sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))\n\nexport async function retry\u003CT>(\n  task: () => Promise\u003CT>,\n  options: RetryOptions,\n): Promise\u003CT> {\n  const {\n    retries,\n    baseDelayMs = 200,\n    shouldRetry = () => true,\n  } = options\n\n  let lastError: unknown\n\n  for (let attempt = 0; attempt \u003C= retries; attempt++) {\n    try {\n      return await task()\n    } catch (error) {\n      lastError = error\n\n      if (attempt === retries || !shouldRetry(error)) {\n        throw error\n      }\n\n      const backoff = baseDelayMs * 2 ** attempt\n      const wait = Math.random() * backoff\n      await sleep(wait)\n    }\n  }\n\n  throw lastError\n}\n",[541],{"type":22,"tag":46,"props":542,"children":543},{"__ignoreMap":7},[544,567,586,607,659,668,678,781,789,829,868,890,923,936,949,971,1003,1021,1029,1052,1060,1132,1145,1169,1199,1217,1225,1284,1297,1306,1314,1353,1393,1420,1429,1438,1446,1460],{"type":22,"tag":212,"props":545,"children":546},{"class":214,"line":215},[547,552,558,562],{"type":22,"tag":212,"props":548,"children":549},{"style":273},[550],{"type":28,"value":551},"type",{"type":22,"tag":212,"props":553,"children":555},{"style":554},"--shiki-default:#2E8F82;--shiki-default-text-decoration:inherit;--shiki-dark:#5DA994;--shiki-dark-text-decoration:inherit;--shiki-sepia:#A6E22E;--shiki-sepia-text-decoration:underline",[556],{"type":28,"value":557}," RetryOptions",{"type":22,"tag":212,"props":559,"children":560},{"style":285},[561],{"type":28,"value":288},{"type":22,"tag":212,"props":563,"children":564},{"style":408},[565],{"type":28,"value":566}," {\n",{"type":22,"tag":212,"props":568,"children":569},{"class":214,"line":224},[570,575,580],{"type":22,"tag":212,"props":571,"children":572},{"style":279},[573],{"type":28,"value":574},"  retries",{"type":22,"tag":212,"props":576,"children":577},{"style":285},[578],{"type":28,"value":579},":",{"type":22,"tag":212,"props":581,"children":583},{"style":582},"--shiki-default:#2E8F82;--shiki-default-font-style:inherit;--shiki-dark:#5DA994;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[584],{"type":28,"value":585}," number\n",{"type":22,"tag":212,"props":587,"children":588},{"class":214,"line":233},[589,594,599,603],{"type":22,"tag":212,"props":590,"children":591},{"style":279},[592],{"type":28,"value":593},"  baseDelayMs",{"type":22,"tag":212,"props":595,"children":596},{"style":296},[597],{"type":28,"value":598},"?",{"type":22,"tag":212,"props":600,"children":601},{"style":285},[602],{"type":28,"value":579},{"type":22,"tag":212,"props":604,"children":605},{"style":582},[606],{"type":28,"value":585},{"type":22,"tag":212,"props":608,"children":609},{"class":214,"line":242},[610,615,619,623,628,634,638,643,648,654],{"type":22,"tag":212,"props":611,"children":612},{"style":414},[613],{"type":28,"value":614},"  shouldRetry",{"type":22,"tag":212,"props":616,"children":617},{"style":296},[618],{"type":28,"value":598},{"type":22,"tag":212,"props":620,"children":621},{"style":285},[622],{"type":28,"value":579},{"type":22,"tag":212,"props":624,"children":625},{"style":408},[626],{"type":28,"value":627}," (",{"type":22,"tag":212,"props":629,"children":631},{"style":630},"--shiki-default:#B07D48;--shiki-default-font-style:inherit;--shiki-dark:#BD976A;--shiki-dark-font-style:inherit;--shiki-sepia:#FD971F;--shiki-sepia-font-style:italic",[632],{"type":28,"value":633},"error",{"type":22,"tag":212,"props":635,"children":636},{"style":285},[637],{"type":28,"value":579},{"type":22,"tag":212,"props":639,"children":640},{"style":582},[641],{"type":28,"value":642}," unknown",{"type":22,"tag":212,"props":644,"children":645},{"style":408},[646],{"type":28,"value":647},") ",{"type":22,"tag":212,"props":649,"children":651},{"style":650},"--shiki-default:#999999;--shiki-default-font-style:inherit;--shiki-dark:#666666;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[652],{"type":28,"value":653},"=>",{"type":22,"tag":212,"props":655,"children":656},{"style":582},[657],{"type":28,"value":658}," boolean\n",{"type":22,"tag":212,"props":660,"children":662},{"class":214,"line":661},5,[663],{"type":22,"tag":212,"props":664,"children":665},{"style":408},[666],{"type":28,"value":667},"}\n",{"type":22,"tag":212,"props":669,"children":671},{"class":214,"line":670},6,[672],{"type":22,"tag":212,"props":673,"children":675},{"emptyLinePlaceholder":674},true,[676],{"type":28,"value":677},"\n",{"type":22,"tag":212,"props":679,"children":681},{"class":214,"line":680},7,[682,686,691,695,699,704,708,713,718,723,728,734,739,744,748,752,757,762,766,771,776],{"type":22,"tag":212,"props":683,"children":684},{"style":273},[685],{"type":28,"value":276},{"type":22,"tag":212,"props":687,"children":688},{"style":414},[689],{"type":28,"value":690}," sleep",{"type":22,"tag":212,"props":692,"children":693},{"style":285},[694],{"type":28,"value":288},{"type":22,"tag":212,"props":696,"children":697},{"style":408},[698],{"type":28,"value":627},{"type":22,"tag":212,"props":700,"children":701},{"style":630},[702],{"type":28,"value":703},"ms",{"type":22,"tag":212,"props":705,"children":706},{"style":285},[707],{"type":28,"value":579},{"type":22,"tag":212,"props":709,"children":710},{"style":582},[711],{"type":28,"value":712}," number",{"type":22,"tag":212,"props":714,"children":715},{"style":408},[716],{"type":28,"value":717},")",{"type":22,"tag":212,"props":719,"children":720},{"style":650},[721],{"type":28,"value":722}," =>",{"type":22,"tag":212,"props":724,"children":725},{"style":296},[726],{"type":28,"value":727}," new",{"type":22,"tag":212,"props":729,"children":731},{"style":730},"--shiki-default:#998418;--shiki-default-font-style:inherit;--shiki-dark:#B8A965;--shiki-dark-font-style:inherit;--shiki-sepia:#66D9EF;--shiki-sepia-font-style:italic",[732],{"type":28,"value":733}," Promise",{"type":22,"tag":212,"props":735,"children":736},{"style":408},[737],{"type":28,"value":738},"((",{"type":22,"tag":212,"props":740,"children":741},{"style":630},[742],{"type":28,"value":743},"resolve",{"type":22,"tag":212,"props":745,"children":746},{"style":408},[747],{"type":28,"value":717},{"type":22,"tag":212,"props":749,"children":750},{"style":650},[751],{"type":28,"value":722},{"type":22,"tag":212,"props":753,"children":754},{"style":414},[755],{"type":28,"value":756}," setTimeout",{"type":22,"tag":212,"props":758,"children":759},{"style":408},[760],{"type":28,"value":761},"(",{"type":22,"tag":212,"props":763,"children":764},{"style":279},[765],{"type":28,"value":743},{"type":22,"tag":212,"props":767,"children":768},{"style":408},[769],{"type":28,"value":770},",",{"type":22,"tag":212,"props":772,"children":773},{"style":279},[774],{"type":28,"value":775}," ms",{"type":22,"tag":212,"props":777,"children":778},{"style":408},[779],{"type":28,"value":780},"))\n",{"type":22,"tag":212,"props":782,"children":784},{"class":214,"line":783},8,[785],{"type":22,"tag":212,"props":786,"children":787},{"emptyLinePlaceholder":674},[788],{"type":28,"value":677},{"type":22,"tag":212,"props":790,"children":792},{"class":214,"line":791},9,[793,799,804,809,814,819,824],{"type":22,"tag":212,"props":794,"children":796},{"style":795},"--shiki-default:#1E754F;--shiki-dark:#4D9375;--shiki-sepia:#F92672",[797],{"type":28,"value":798},"export",{"type":22,"tag":212,"props":800,"children":801},{"style":296},[802],{"type":28,"value":803}," async",{"type":22,"tag":212,"props":805,"children":806},{"style":273},[807],{"type":28,"value":808}," function",{"type":22,"tag":212,"props":810,"children":811},{"style":414},[812],{"type":28,"value":813}," retry",{"type":22,"tag":212,"props":815,"children":816},{"style":408},[817],{"type":28,"value":818},"\u003C",{"type":22,"tag":212,"props":820,"children":821},{"style":554},[822],{"type":28,"value":823},"T",{"type":22,"tag":212,"props":825,"children":826},{"style":408},[827],{"type":28,"value":828},">(\n",{"type":22,"tag":212,"props":830,"children":832},{"class":214,"line":831},10,[833,838,842,847,851,855,859,863],{"type":22,"tag":212,"props":834,"children":835},{"style":414},[836],{"type":28,"value":837},"  task",{"type":22,"tag":212,"props":839,"children":840},{"style":285},[841],{"type":28,"value":579},{"type":22,"tag":212,"props":843,"children":844},{"style":408},[845],{"type":28,"value":846}," () ",{"type":22,"tag":212,"props":848,"children":849},{"style":650},[850],{"type":28,"value":653},{"type":22,"tag":212,"props":852,"children":853},{"style":554},[854],{"type":28,"value":733},{"type":22,"tag":212,"props":856,"children":857},{"style":408},[858],{"type":28,"value":818},{"type":22,"tag":212,"props":860,"children":861},{"style":554},[862],{"type":28,"value":823},{"type":22,"tag":212,"props":864,"children":865},{"style":408},[866],{"type":28,"value":867},">,\n",{"type":22,"tag":212,"props":869,"children":871},{"class":214,"line":870},11,[872,877,881,885],{"type":22,"tag":212,"props":873,"children":874},{"style":630},[875],{"type":28,"value":876},"  options",{"type":22,"tag":212,"props":878,"children":879},{"style":285},[880],{"type":28,"value":579},{"type":22,"tag":212,"props":882,"children":883},{"style":554},[884],{"type":28,"value":557},{"type":22,"tag":212,"props":886,"children":887},{"style":408},[888],{"type":28,"value":889},",\n",{"type":22,"tag":212,"props":891,"children":893},{"class":214,"line":892},12,[894,898,902,906,910,914,919],{"type":22,"tag":212,"props":895,"children":896},{"style":408},[897],{"type":28,"value":717},{"type":22,"tag":212,"props":899,"children":900},{"style":285},[901],{"type":28,"value":579},{"type":22,"tag":212,"props":903,"children":904},{"style":554},[905],{"type":28,"value":733},{"type":22,"tag":212,"props":907,"children":908},{"style":408},[909],{"type":28,"value":818},{"type":22,"tag":212,"props":911,"children":912},{"style":554},[913],{"type":28,"value":823},{"type":22,"tag":212,"props":915,"children":916},{"style":408},[917],{"type":28,"value":918},">",{"type":22,"tag":212,"props":920,"children":921},{"style":408},[922],{"type":28,"value":566},{"type":22,"tag":212,"props":924,"children":926},{"class":214,"line":925},13,[927,932],{"type":22,"tag":212,"props":928,"children":929},{"style":273},[930],{"type":28,"value":931},"  const",{"type":22,"tag":212,"props":933,"children":934},{"style":408},[935],{"type":28,"value":566},{"type":22,"tag":212,"props":937,"children":939},{"class":214,"line":938},14,[940,945],{"type":22,"tag":212,"props":941,"children":942},{"style":279},[943],{"type":28,"value":944},"    retries",{"type":22,"tag":212,"props":946,"children":947},{"style":408},[948],{"type":28,"value":889},{"type":22,"tag":212,"props":950,"children":952},{"class":214,"line":951},15,[953,958,962,967],{"type":22,"tag":212,"props":954,"children":955},{"style":279},[956],{"type":28,"value":957},"    baseDelayMs",{"type":22,"tag":212,"props":959,"children":960},{"style":285},[961],{"type":28,"value":288},{"type":22,"tag":212,"props":963,"children":964},{"style":302},[965],{"type":28,"value":966}," 200",{"type":22,"tag":212,"props":968,"children":969},{"style":408},[970],{"type":28,"value":889},{"type":22,"tag":212,"props":972,"children":974},{"class":214,"line":973},16,[975,980,984,989,993,999],{"type":22,"tag":212,"props":976,"children":977},{"style":279},[978],{"type":28,"value":979},"    shouldRetry",{"type":22,"tag":212,"props":981,"children":982},{"style":285},[983],{"type":28,"value":288},{"type":22,"tag":212,"props":985,"children":986},{"style":408},[987],{"type":28,"value":988}," ()",{"type":22,"tag":212,"props":990,"children":991},{"style":650},[992],{"type":28,"value":722},{"type":22,"tag":212,"props":994,"children":996},{"style":995},"--shiki-default:#1E754F;--shiki-dark:#4D9375;--shiki-sepia:#AE81FF",[997],{"type":28,"value":998}," true",{"type":22,"tag":212,"props":1000,"children":1001},{"style":408},[1002],{"type":28,"value":889},{"type":22,"tag":212,"props":1004,"children":1006},{"class":214,"line":1005},17,[1007,1012,1016],{"type":22,"tag":212,"props":1008,"children":1009},{"style":408},[1010],{"type":28,"value":1011},"  }",{"type":22,"tag":212,"props":1013,"children":1014},{"style":285},[1015],{"type":28,"value":288},{"type":22,"tag":212,"props":1017,"children":1018},{"style":279},[1019],{"type":28,"value":1020}," options\n",{"type":22,"tag":212,"props":1022,"children":1024},{"class":214,"line":1023},18,[1025],{"type":22,"tag":212,"props":1026,"children":1027},{"emptyLinePlaceholder":674},[1028],{"type":28,"value":677},{"type":22,"tag":212,"props":1030,"children":1032},{"class":214,"line":1031},19,[1033,1038,1043,1047],{"type":22,"tag":212,"props":1034,"children":1035},{"style":273},[1036],{"type":28,"value":1037},"  let",{"type":22,"tag":212,"props":1039,"children":1040},{"style":279},[1041],{"type":28,"value":1042}," lastError",{"type":22,"tag":212,"props":1044,"children":1045},{"style":285},[1046],{"type":28,"value":579},{"type":22,"tag":212,"props":1048,"children":1049},{"style":582},[1050],{"type":28,"value":1051}," unknown\n",{"type":22,"tag":212,"props":1053,"children":1055},{"class":214,"line":1054},20,[1056],{"type":22,"tag":212,"props":1057,"children":1058},{"emptyLinePlaceholder":674},[1059],{"type":28,"value":677},{"type":22,"tag":212,"props":1061,"children":1063},{"class":214,"line":1062},21,[1064,1069,1073,1078,1083,1087,1092,1097,1101,1106,1111,1115,1119,1124,1128],{"type":22,"tag":212,"props":1065,"children":1066},{"style":795},[1067],{"type":28,"value":1068},"  for",{"type":22,"tag":212,"props":1070,"children":1071},{"style":408},[1072],{"type":28,"value":627},{"type":22,"tag":212,"props":1074,"children":1075},{"style":273},[1076],{"type":28,"value":1077},"let",{"type":22,"tag":212,"props":1079,"children":1080},{"style":279},[1081],{"type":28,"value":1082}," attempt",{"type":22,"tag":212,"props":1084,"children":1085},{"style":285},[1086],{"type":28,"value":288},{"type":22,"tag":212,"props":1088,"children":1089},{"style":302},[1090],{"type":28,"value":1091}," 0",{"type":22,"tag":212,"props":1093,"children":1094},{"style":408},[1095],{"type":28,"value":1096},";",{"type":22,"tag":212,"props":1098,"children":1099},{"style":279},[1100],{"type":28,"value":1082},{"type":22,"tag":212,"props":1102,"children":1103},{"style":285},[1104],{"type":28,"value":1105}," \u003C=",{"type":22,"tag":212,"props":1107,"children":1108},{"style":279},[1109],{"type":28,"value":1110}," retries",{"type":22,"tag":212,"props":1112,"children":1113},{"style":408},[1114],{"type":28,"value":1096},{"type":22,"tag":212,"props":1116,"children":1117},{"style":279},[1118],{"type":28,"value":1082},{"type":22,"tag":212,"props":1120,"children":1121},{"style":296},[1122],{"type":28,"value":1123},"++",{"type":22,"tag":212,"props":1125,"children":1126},{"style":408},[1127],{"type":28,"value":717},{"type":22,"tag":212,"props":1129,"children":1130},{"style":408},[1131],{"type":28,"value":566},{"type":22,"tag":212,"props":1133,"children":1135},{"class":214,"line":1134},22,[1136,1141],{"type":22,"tag":212,"props":1137,"children":1138},{"style":795},[1139],{"type":28,"value":1140},"    try",{"type":22,"tag":212,"props":1142,"children":1143},{"style":408},[1144],{"type":28,"value":566},{"type":22,"tag":212,"props":1146,"children":1148},{"class":214,"line":1147},23,[1149,1154,1159,1164],{"type":22,"tag":212,"props":1150,"children":1151},{"style":795},[1152],{"type":28,"value":1153},"      return",{"type":22,"tag":212,"props":1155,"children":1156},{"style":795},[1157],{"type":28,"value":1158}," await",{"type":22,"tag":212,"props":1160,"children":1161},{"style":414},[1162],{"type":28,"value":1163}," task",{"type":22,"tag":212,"props":1165,"children":1166},{"style":408},[1167],{"type":28,"value":1168},"()\n",{"type":22,"tag":212,"props":1170,"children":1172},{"class":214,"line":1171},24,[1173,1178,1183,1187,1191,1195],{"type":22,"tag":212,"props":1174,"children":1175},{"style":408},[1176],{"type":28,"value":1177},"    }",{"type":22,"tag":212,"props":1179,"children":1180},{"style":795},[1181],{"type":28,"value":1182}," catch",{"type":22,"tag":212,"props":1184,"children":1185},{"style":408},[1186],{"type":28,"value":627},{"type":22,"tag":212,"props":1188,"children":1189},{"style":279},[1190],{"type":28,"value":633},{"type":22,"tag":212,"props":1192,"children":1193},{"style":408},[1194],{"type":28,"value":717},{"type":22,"tag":212,"props":1196,"children":1197},{"style":408},[1198],{"type":28,"value":566},{"type":22,"tag":212,"props":1200,"children":1202},{"class":214,"line":1201},25,[1203,1208,1212],{"type":22,"tag":212,"props":1204,"children":1205},{"style":279},[1206],{"type":28,"value":1207},"      lastError",{"type":22,"tag":212,"props":1209,"children":1210},{"style":285},[1211],{"type":28,"value":288},{"type":22,"tag":212,"props":1213,"children":1214},{"style":279},[1215],{"type":28,"value":1216}," error\n",{"type":22,"tag":212,"props":1218,"children":1220},{"class":214,"line":1219},26,[1221],{"type":22,"tag":212,"props":1222,"children":1223},{"emptyLinePlaceholder":674},[1224],{"type":28,"value":677},{"type":22,"tag":212,"props":1226,"children":1228},{"class":214,"line":1227},27,[1229,1234,1238,1243,1248,1252,1257,1262,1267,1271,1275,1280],{"type":22,"tag":212,"props":1230,"children":1231},{"style":795},[1232],{"type":28,"value":1233},"      if",{"type":22,"tag":212,"props":1235,"children":1236},{"style":408},[1237],{"type":28,"value":627},{"type":22,"tag":212,"props":1239,"children":1240},{"style":279},[1241],{"type":28,"value":1242},"attempt",{"type":22,"tag":212,"props":1244,"children":1245},{"style":296},[1246],{"type":28,"value":1247}," ===",{"type":22,"tag":212,"props":1249,"children":1250},{"style":279},[1251],{"type":28,"value":1110},{"type":22,"tag":212,"props":1253,"children":1254},{"style":296},[1255],{"type":28,"value":1256}," ||",{"type":22,"tag":212,"props":1258,"children":1259},{"style":296},[1260],{"type":28,"value":1261}," !",{"type":22,"tag":212,"props":1263,"children":1264},{"style":414},[1265],{"type":28,"value":1266},"shouldRetry",{"type":22,"tag":212,"props":1268,"children":1269},{"style":408},[1270],{"type":28,"value":761},{"type":22,"tag":212,"props":1272,"children":1273},{"style":279},[1274],{"type":28,"value":633},{"type":22,"tag":212,"props":1276,"children":1277},{"style":408},[1278],{"type":28,"value":1279},"))",{"type":22,"tag":212,"props":1281,"children":1282},{"style":408},[1283],{"type":28,"value":566},{"type":22,"tag":212,"props":1285,"children":1287},{"class":214,"line":1286},28,[1288,1293],{"type":22,"tag":212,"props":1289,"children":1290},{"style":795},[1291],{"type":28,"value":1292},"        throw",{"type":22,"tag":212,"props":1294,"children":1295},{"style":279},[1296],{"type":28,"value":1216},{"type":22,"tag":212,"props":1298,"children":1300},{"class":214,"line":1299},29,[1301],{"type":22,"tag":212,"props":1302,"children":1303},{"style":408},[1304],{"type":28,"value":1305},"      }\n",{"type":22,"tag":212,"props":1307,"children":1309},{"class":214,"line":1308},30,[1310],{"type":22,"tag":212,"props":1311,"children":1312},{"emptyLinePlaceholder":674},[1313],{"type":28,"value":677},{"type":22,"tag":212,"props":1315,"children":1317},{"class":214,"line":1316},31,[1318,1323,1328,1332,1337,1341,1345,1349],{"type":22,"tag":212,"props":1319,"children":1320},{"style":273},[1321],{"type":28,"value":1322},"      const",{"type":22,"tag":212,"props":1324,"children":1325},{"style":279},[1326],{"type":28,"value":1327}," backoff",{"type":22,"tag":212,"props":1329,"children":1330},{"style":285},[1331],{"type":28,"value":288},{"type":22,"tag":212,"props":1333,"children":1334},{"style":279},[1335],{"type":28,"value":1336}," baseDelayMs",{"type":22,"tag":212,"props":1338,"children":1339},{"style":296},[1340],{"type":28,"value":299},{"type":22,"tag":212,"props":1342,"children":1343},{"style":302},[1344],{"type":28,"value":305},{"type":22,"tag":212,"props":1346,"children":1347},{"style":296},[1348],{"type":28,"value":310},{"type":22,"tag":212,"props":1350,"children":1351},{"style":279},[1352],{"type":28,"value":315},{"type":22,"tag":212,"props":1354,"children":1356},{"class":214,"line":1355},32,[1357,1361,1365,1369,1373,1377,1381,1385,1389],{"type":22,"tag":212,"props":1358,"children":1359},{"style":273},[1360],{"type":28,"value":1322},{"type":22,"tag":212,"props":1362,"children":1363},{"style":279},[1364],{"type":28,"value":396},{"type":22,"tag":212,"props":1366,"children":1367},{"style":285},[1368],{"type":28,"value":288},{"type":22,"tag":212,"props":1370,"children":1371},{"style":279},[1372],{"type":28,"value":405},{"type":22,"tag":212,"props":1374,"children":1375},{"style":408},[1376],{"type":28,"value":411},{"type":22,"tag":212,"props":1378,"children":1379},{"style":414},[1380],{"type":28,"value":417},{"type":22,"tag":212,"props":1382,"children":1383},{"style":408},[1384],{"type":28,"value":422},{"type":22,"tag":212,"props":1386,"children":1387},{"style":296},[1388],{"type":28,"value":299},{"type":22,"tag":212,"props":1390,"children":1391},{"style":279},[1392],{"type":28,"value":431},{"type":22,"tag":212,"props":1394,"children":1396},{"class":214,"line":1395},33,[1397,1402,1406,1410,1415],{"type":22,"tag":212,"props":1398,"children":1399},{"style":795},[1400],{"type":28,"value":1401},"      await",{"type":22,"tag":212,"props":1403,"children":1404},{"style":414},[1405],{"type":28,"value":690},{"type":22,"tag":212,"props":1407,"children":1408},{"style":408},[1409],{"type":28,"value":761},{"type":22,"tag":212,"props":1411,"children":1412},{"style":279},[1413],{"type":28,"value":1414},"wait",{"type":22,"tag":212,"props":1416,"children":1417},{"style":408},[1418],{"type":28,"value":1419},")\n",{"type":22,"tag":212,"props":1421,"children":1423},{"class":214,"line":1422},34,[1424],{"type":22,"tag":212,"props":1425,"children":1426},{"style":408},[1427],{"type":28,"value":1428},"    }\n",{"type":22,"tag":212,"props":1430,"children":1432},{"class":214,"line":1431},35,[1433],{"type":22,"tag":212,"props":1434,"children":1435},{"style":408},[1436],{"type":28,"value":1437},"  }\n",{"type":22,"tag":212,"props":1439,"children":1441},{"class":214,"line":1440},36,[1442],{"type":22,"tag":212,"props":1443,"children":1444},{"emptyLinePlaceholder":674},[1445],{"type":28,"value":677},{"type":22,"tag":212,"props":1447,"children":1449},{"class":214,"line":1448},37,[1450,1455],{"type":22,"tag":212,"props":1451,"children":1452},{"style":795},[1453],{"type":28,"value":1454},"  throw",{"type":22,"tag":212,"props":1456,"children":1457},{"style":279},[1458],{"type":28,"value":1459}," lastError\n",{"type":22,"tag":212,"props":1461,"children":1463},{"class":214,"line":1462},38,[1464],{"type":22,"tag":212,"props":1465,"children":1466},{"style":408},[1467],{"type":28,"value":667},{"type":22,"tag":30,"props":1469,"children":1470},{},[1471],{"type":28,"value":1472},"这段代码的重点不是语法，而是边界：",{"type":22,"tag":63,"props":1474,"children":1475},{},[1476,1481,1486],{"type":22,"tag":67,"props":1477,"children":1478},{},[1479],{"type":28,"value":1480},"重试次数有上限",{"type":22,"tag":67,"props":1482,"children":1483},{},[1484],{"type":28,"value":1485},"失败条件可定制",{"type":22,"tag":67,"props":1487,"children":1488},{},[1489],{"type":28,"value":1490},"等待时间不是固定值",{"type":22,"tag":30,"props":1492,"children":1493},{},[1494,1496,1502],{"type":28,"value":1495},"如果你在 Node.js 里处理 HTTP 请求，还可以把 ",{"type":22,"tag":46,"props":1497,"children":1499},{"className":1498},[],[1500],{"type":28,"value":1501},"AbortSignal",{"type":28,"value":1503}," 接进来，让调用方在超时或取消时直接终止重试。",{"type":22,"tag":39,"props":1505,"children":1507},{"id":1506},"别把重试当成补锅",[1508],{"type":28,"value":1506},{"type":22,"tag":30,"props":1510,"children":1511},{},[1512],{"type":28,"value":1513},"重试应该处理的是短暂波动，不应该掩盖架构问题。",{"type":22,"tag":30,"props":1515,"children":1516},{},[1517],{"type":28,"value":1518},"如果一个接口经常需要三四次才能成功，通常说明下面至少有一个问题：",{"type":22,"tag":63,"props":1520,"children":1521},{},[1522,1527,1532,1537,1542],{"type":22,"tag":67,"props":1523,"children":1524},{},[1525],{"type":28,"value":1526},"超时阈值设得太激进",{"type":22,"tag":67,"props":1528,"children":1529},{},[1530],{"type":28,"value":1531},"下游稳定性不够",{"type":22,"tag":67,"props":1533,"children":1534},{},[1535],{"type":28,"value":1536},"调用链太长",{"type":22,"tag":67,"props":1538,"children":1539},{},[1540],{"type":28,"value":1541},"缓存没有命中",{"type":22,"tag":67,"props":1543,"children":1544},{},[1545],{"type":28,"value":1546},"并发控制缺失",{"type":22,"tag":30,"props":1548,"children":1549},{},[1550],{"type":28,"value":1551},"这时候继续加重试，只是在延迟问题暴露的时间。",{"type":22,"tag":30,"props":1553,"children":1554},{},[1555],{"type":28,"value":1556},"更好的做法是把重试和观测一起看：",{"type":22,"tag":63,"props":1558,"children":1559},{},[1560,1565,1570,1575],{"type":22,"tag":67,"props":1561,"children":1562},{},[1563],{"type":28,"value":1564},"记录每次重试的原因",{"type":22,"tag":67,"props":1566,"children":1567},{},[1568],{"type":28,"value":1569},"统计最终成功率和失败率",{"type":22,"tag":67,"props":1571,"children":1572},{},[1573],{"type":28,"value":1574},"关注重试后的尾延迟",{"type":22,"tag":67,"props":1576,"children":1577},{},[1578],{"type":28,"value":1579},"对高频失败的错误单独报警",{"type":22,"tag":30,"props":1581,"children":1582},{},[1583],{"type":28,"value":1584},"重试本身不是目标，稳定才是目标。",{"type":22,"tag":39,"props":1586,"children":1588},{"id":1587},"一个实用检查表",[1589],{"type":28,"value":1587},{"type":22,"tag":30,"props":1591,"children":1592},{},[1593],{"type":28,"value":1594},"上线前可以用这几条快速检查重试策略：",{"type":22,"tag":63,"props":1596,"children":1597},{},[1598,1603,1608,1613,1618,1623,1628],{"type":22,"tag":67,"props":1599,"children":1600},{},[1601],{"type":28,"value":1602},"只重试临时性错误",{"type":22,"tag":67,"props":1604,"children":1605},{},[1606],{"type":28,"value":1607},"有最大重试次数",{"type":22,"tag":67,"props":1609,"children":1610},{},[1611],{"type":28,"value":1612},"有退避",{"type":22,"tag":67,"props":1614,"children":1615},{},[1616],{"type":28,"value":1617},"有抖动",{"type":22,"tag":67,"props":1619,"children":1620},{},[1621],{"type":28,"value":1622},"有幂等保护",{"type":22,"tag":67,"props":1624,"children":1625},{},[1626],{"type":28,"value":1627},"有超时上限",{"type":22,"tag":67,"props":1629,"children":1630},{},[1631],{"type":28,"value":1632},"有日志和指标",{"type":22,"tag":30,"props":1634,"children":1635},{},[1636],{"type":28,"value":1637},"如果这七项里少了两三项，重试大概率只是“看起来更稳”，不是“真的更稳”。",{"type":22,"tag":39,"props":1639,"children":1641},{"id":1640},"总结",[1642],{"type":28,"value":1640},{"type":22,"tag":30,"props":1644,"children":1645},{},[1646],{"type":28,"value":1647},"重试不是把失败再做一遍，而是用受控的方式给系统一次恢复机会。",{"type":22,"tag":30,"props":1649,"children":1650},{},[1651],{"type":28,"value":1652},"真正可靠的重试，至少要同时考虑三件事：错误是不是值得重试、等待节奏会不会放大故障、重复执行会不会产生副作用。",{"type":22,"tag":30,"props":1654,"children":1655},{},[1656],{"type":28,"value":1657},"把退避、抖动和幂等一起设计进去，重试才会从“碰碰运气”变成“可预测的容错策略”。",{"type":22,"tag":1659,"props":1660,"children":1661},"style",{},[1662],{"type":28,"value":1663},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html .sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}html.sepia .shiki span {color: var(--shiki-sepia);background: var(--shiki-sepia-bg);font-style: var(--shiki-sepia-font-style);font-weight: var(--shiki-sepia-font-weight);text-decoration: var(--shiki-sepia-text-decoration);}",{"title":7,"searchDepth":224,"depth":224,"links":1665},[1666,1668,1672,1673,1674,1675,1676,1677,1678],{"id":41,"depth":224,"text":1667},"为什么重试不能只写一个 while",{"id":94,"depth":224,"text":94,"children":1669},[1670,1671],{"id":105,"depth":233,"text":105},{"id":138,"depth":233,"text":138},{"id":189,"depth":224,"text":189},{"id":323,"depth":224,"text":323},{"id":439,"depth":224,"text":439},{"id":511,"depth":224,"text":511},{"id":1506,"depth":224,"text":1506},{"id":1587,"depth":224,"text":1587},{"id":1640,"depth":224,"text":1640},"markdown","content:blog:2026-06-05-retry-policy-basics.md","content","blog/2026-06-05-retry-policy-basics.md","blog/2026-06-05-retry-policy-basics","md",1780733631881]