<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>异步异常处理 on 知识铺的博客</title>
    <link>https://index.zshipu.com/geek/tags/%E5%BC%82%E6%AD%A5%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86/</link>
    <description>Recent content in 异步异常处理 on 知识铺的博客</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>zh-CN</language>
    <lastBuildDate>Thu, 03 Sep 2026 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://index.zshipu.com/geek/tags/%E5%BC%82%E6%AD%A5%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>@Async 三大坑：事务丢失、MDC 上下文消失、异常被静默吞掉</title>
      <link>https://index.zshipu.com/geek/post/20260903/Async-%E4%B8%89%E5%A4%A7%E5%9D%91%E4%BA%8B%E5%8A%A1%E4%B8%A2%E5%A4%B1MDC-%E4%B8%8A%E4%B8%8B%E6%96%87%E6%B6%88%E5%A4%B1%E5%BC%82%E5%B8%B8%E8%A2%AB%E9%9D%99%E9%BB%98%E5%90%9E%E6%8E%89/</link>
      <pubDate>Thu, 03 Sep 2026 00:00:00 +0000</pubDate>
      <guid>https://index.zshipu.com/geek/post/20260903/Async-%E4%B8%89%E5%A4%A7%E5%9D%91%E4%BA%8B%E5%8A%A1%E4%B8%A2%E5%A4%B1MDC-%E4%B8%8A%E4%B8%8B%E6%96%87%E6%B6%88%E5%A4%B1%E5%BC%82%E5%B8%B8%E8%A2%AB%E9%9D%99%E9%BB%98%E5%90%9E%E6%8E%89/</guid>
      <description>@Async 只负责换线程执行，不负责事务一致性、上下文复制和异常可靠投递。 生产环境里因此丢失数据、丢日志、吞异常的情况反复出现，根治只能靠明确事务边界、装饰线程池和持久化关键任务。 事务上下文不会随 @Async 传递到子线程 在 Spring 中，@Async 方法默认使用 SimpleAsyncTaskExecutor 或自定义的 ThreadPoolTaskExecutor 执行。事务由 TransactionSynchronizationManager 绑定在当前线程的 ThreadLocal 上</description>
    </item>
  </channel>
</rss>
