<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>重试 on Leanku</title>
    <link>https://blog.leanku.com/tags/%E9%87%8D%E8%AF%95/</link>
    <description>Recent content in 重试 on Leanku</description>
    <image>
      <url>https://blog.leanku.com/papermod-cover.png</url>
      <link>https://blog.leanku.com/papermod-cover.png</link>
    </image>
    <generator>Hugo -- gohugo.io</generator>
    <lastBuildDate>Fri, 11 Jul 2025 20:46:01 +0800</lastBuildDate><atom:link href="https://blog.leanku.com/tags/%E9%87%8D%E8%AF%95/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>高并发系统设计-重试</title>
      <link>https://blog.leanku.com/post/microservice/%E9%AB%98%E5%B9%B6%E5%8F%91%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1-%E9%87%8D%E8%AF%95/</link>
      <pubDate>Fri, 11 Jul 2025 20:46:01 +0800</pubDate>
      
      <guid>https://blog.leanku.com/post/microservice/%E9%AB%98%E5%B9%B6%E5%8F%91%E7%B3%BB%E7%BB%9F%E8%AE%BE%E8%AE%A1-%E9%87%8D%E8%AF%95/</guid>
      <description>高并发系统设计-重试 一、概述 1.1 什么是重试 重试（Retry）是指：
当一次请求失败后，在满足条件的情况下再次发起请求，以提高成功率。
例如：
请求 → 失败 → 再请求 → 成功
1.2 为什么需要重试 在分布式系统中，失败是常态：
网络抖动 RPC短暂超时 Redis瞬时不可用 MySQL连接波动 依赖服务重启 例如：
请求支付服务 → 超时 但实际服务是正常的 如果不重试：用户支付失败
但如果允许重试：
第一次失败
第二次成功
1.3 重试解决的问题 重试主要解决：
1. 短暂故障 如： 网络抖动 服务瞬断 连接超时
2.依赖服务不稳定 如：
第三方支付 / 短信 / API
3.提高成功率 1.4 重试的误区 错误做法 ： 失败 → 立即重试 → 再失败 → 无限循环
正确做法是：可控重试 + 退避策略 + 最大次数限制
二、原理 2.1 重试的核心思想 重试本质是：
用时间换成功率
但前提是：</description>
    </item>
    
  </channel>
</rss>
