[{"data":1,"prerenderedAt":1672},["ShallowReactive",2],{"post-\u002Fblog\u002F2026-09-09-genesis-table-detail-truth":3,"surround-\u002Fblog\u002F2026-09-09-genesis-table-detail-truth":1665},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"title":8,"description":9,"date":10,"tags":11,"body":16,"_type":1659,"_id":1660,"_source":1661,"_file":1662,"_stem":1663,"_extension":1664},"\u002Fblog\u002F2026-09-09-genesis-table-detail-truth","blog",false,"","查询失败了，页面却亮绿灯：表详情页的修复，和一个改了三次的线程池","子查询失败被显示成零值和绿灯。后端改成每段单独报状态，前端接上以后又修掉六处断链，线程池队列从 100 收到 16。","2026-09-09",[12,13,14,15],"Genesis","后端","线程池","问题复盘",{"type":17,"children":18,"toc":1651},"root",[19,42,47,52,57,63,84,230,243,449,454,460,480,493,502,515,592,604,609,667,688,793,798,803,816,821,826,831,948,956,968,973,978,983,1366,1371,1384,1390,1409,1414,1517,1562,1583,1588,1596,1608,1613,1625,1645],{"type":20,"tag":21,"props":22,"children":23},"element","p",{},[24,31,33,40],{"type":20,"tag":25,"props":26,"children":28},"a",{"href":27},"\u002Fprojects\u002Fgenesis\u002F",[29],{"type":30,"value":12},"text",{"type":30,"value":32}," 的表详情页顶上有一个健康点，分绿、黄、红、灰四种颜色，下面有质量和运行两个 Tab。这些数据来自 ",{"type":20,"tag":34,"props":35,"children":37},"code",{"className":36},[],[38],{"type":30,"value":39},"\u002Ffull",{"type":30,"value":41}," 这个接口，它在后端把质量、Incident（平台记录的一次故障）、变更几路子查询并行跑完，再拼成一个响应。",{"type":20,"tag":21,"props":43,"children":44},{},[45],{"type":30,"value":46},"9 月 3 号，我准备把这段聚合逻辑从 Controller 里挪到一个单独的服务里，好让 Agent 也能读到同一份表上下文。写计划时对着旧代码过了一遍，发现这个页面在出错时会说假话：子查询失败了，返回的是全零的摘要，健康点照样亮绿灯。",{"type":20,"tag":21,"props":48,"children":49},{},[50],{"type":30,"value":51},"这类问题我在产品路线文档里专门记过，叫「绿灯断链」：代码在，页面能打开，编译通过，单测全绿，但链路上某一环是断的，而且不报任何错。",{"type":20,"tag":21,"props":53,"children":54},{},[55],{"type":30,"value":56},"下面的代码来自两份实施计划和对应的提交，有删减。",{"type":20,"tag":58,"props":59,"children":61},"h2",{"id":60},"原来的聚合是怎么写的",[62],{"type":30,"value":60},{"type":20,"tag":21,"props":64,"children":65},{},[66,68,74,76,82],{"type":30,"value":67},"旧的 ",{"type":20,"tag":34,"props":69,"children":71},{"className":70},[],[72],{"type":30,"value":73},"TableCommandCenterController",{"type":30,"value":75}," 用 ",{"type":20,"tag":34,"props":77,"children":79},{"className":78},[],[80],{"type":30,"value":81},"CompletableFuture.supplyAsync",{"type":30,"value":83}," 并行跑三路子查询，没指定线程池，总共最多等 5 秒：",{"type":20,"tag":85,"props":86,"children":90},"pre",{"className":87,"code":88,"language":89,"meta":7,"style":7},"language-java shiki shiki-themes github-light github-dark","try {\n    CompletableFuture.allOf(qualityFuture, incidentFuture, changesFuture)\n            .get(SUB_QUERY_TIMEOUT_SEC, TimeUnit.SECONDS);\n} catch (Exception e) {\n    log.warn(\"聚合子查询超时或失败 qName={}: {}\", qName, e.getMessage());\n}\n","java",[91],{"type":20,"tag":34,"props":92,"children":93},{"__ignoreMap":7},[94,112,132,151,181,221],{"type":20,"tag":95,"props":96,"children":99},"span",{"class":97,"line":98},"line",1,[100,106],{"type":20,"tag":95,"props":101,"children":103},{"style":102},"--shiki-default:#D73A49;--shiki-dark:#F97583",[104],{"type":30,"value":105},"try",{"type":20,"tag":95,"props":107,"children":109},{"style":108},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[110],{"type":30,"value":111}," {\n",{"type":20,"tag":95,"props":113,"children":115},{"class":97,"line":114},2,[116,121,127],{"type":20,"tag":95,"props":117,"children":118},{"style":108},[119],{"type":30,"value":120},"    CompletableFuture.",{"type":20,"tag":95,"props":122,"children":124},{"style":123},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[125],{"type":30,"value":126},"allOf",{"type":20,"tag":95,"props":128,"children":129},{"style":108},[130],{"type":30,"value":131},"(qualityFuture, incidentFuture, changesFuture)\n",{"type":20,"tag":95,"props":133,"children":135},{"class":97,"line":134},3,[136,141,146],{"type":20,"tag":95,"props":137,"children":138},{"style":108},[139],{"type":30,"value":140},"            .",{"type":20,"tag":95,"props":142,"children":143},{"style":123},[144],{"type":30,"value":145},"get",{"type":20,"tag":95,"props":147,"children":148},{"style":108},[149],{"type":30,"value":150},"(SUB_QUERY_TIMEOUT_SEC, TimeUnit.SECONDS);\n",{"type":20,"tag":95,"props":152,"children":154},{"class":97,"line":153},4,[155,160,165,170,176],{"type":20,"tag":95,"props":156,"children":157},{"style":108},[158],{"type":30,"value":159},"} ",{"type":20,"tag":95,"props":161,"children":162},{"style":102},[163],{"type":30,"value":164},"catch",{"type":20,"tag":95,"props":166,"children":167},{"style":108},[168],{"type":30,"value":169}," (Exception ",{"type":20,"tag":95,"props":171,"children":173},{"style":172},"--shiki-default:#E36209;--shiki-dark:#FFAB70",[174],{"type":30,"value":175},"e",{"type":20,"tag":95,"props":177,"children":178},{"style":108},[179],{"type":30,"value":180},") {\n",{"type":20,"tag":95,"props":182,"children":184},{"class":97,"line":183},5,[185,190,195,200,206,211,216],{"type":20,"tag":95,"props":186,"children":187},{"style":108},[188],{"type":30,"value":189},"    log.",{"type":20,"tag":95,"props":191,"children":192},{"style":123},[193],{"type":30,"value":194},"warn",{"type":20,"tag":95,"props":196,"children":197},{"style":108},[198],{"type":30,"value":199},"(",{"type":20,"tag":95,"props":201,"children":203},{"style":202},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[204],{"type":30,"value":205},"\"聚合子查询超时或失败 qName={}: {}\"",{"type":20,"tag":95,"props":207,"children":208},{"style":108},[209],{"type":30,"value":210},", qName, e.",{"type":20,"tag":95,"props":212,"children":213},{"style":123},[214],{"type":30,"value":215},"getMessage",{"type":20,"tag":95,"props":217,"children":218},{"style":108},[219],{"type":30,"value":220},"());\n",{"type":20,"tag":95,"props":222,"children":224},{"class":97,"line":223},6,[225],{"type":20,"tag":95,"props":226,"children":227},{"style":108},[228],{"type":30,"value":229},"}\n",{"type":20,"tag":21,"props":231,"children":232},{},[233,235,241],{"type":30,"value":234},"没跑完的段会被 ",{"type":20,"tag":34,"props":236,"children":238},{"className":237},[],[239],{"type":30,"value":240},"putIfNotNull",{"type":30,"value":242}," 跳过，响应里直接少一个键。更要命的是每个段构建器里面还有一层 try\u002Fcatch，质量摘要是这么兜底的：",{"type":20,"tag":85,"props":244,"children":246},{"className":87,"code":245,"language":89,"meta":7,"style":7},"} catch (Exception e) {\n    log.warn(\"质量摘要构建失败 qName={}: {}\", qualifiedName, e.getMessage());\n    node.put(\"totalRules\", 0);\n    node.put(\"passedRules\", 0);\n    node.put(\"failedRules\", 0);\n    node.put(\"hasFailure\", false);\n}\n",[247],{"type":20,"tag":34,"props":248,"children":249},{"__ignoreMap":7},[250,273,306,344,376,408,441],{"type":20,"tag":95,"props":251,"children":252},{"class":97,"line":98},[253,257,261,265,269],{"type":20,"tag":95,"props":254,"children":255},{"style":108},[256],{"type":30,"value":159},{"type":20,"tag":95,"props":258,"children":259},{"style":102},[260],{"type":30,"value":164},{"type":20,"tag":95,"props":262,"children":263},{"style":108},[264],{"type":30,"value":169},{"type":20,"tag":95,"props":266,"children":267},{"style":172},[268],{"type":30,"value":175},{"type":20,"tag":95,"props":270,"children":271},{"style":108},[272],{"type":30,"value":180},{"type":20,"tag":95,"props":274,"children":275},{"class":97,"line":114},[276,280,284,288,293,298,302],{"type":20,"tag":95,"props":277,"children":278},{"style":108},[279],{"type":30,"value":189},{"type":20,"tag":95,"props":281,"children":282},{"style":123},[283],{"type":30,"value":194},{"type":20,"tag":95,"props":285,"children":286},{"style":108},[287],{"type":30,"value":199},{"type":20,"tag":95,"props":289,"children":290},{"style":202},[291],{"type":30,"value":292},"\"质量摘要构建失败 qName={}: {}\"",{"type":20,"tag":95,"props":294,"children":295},{"style":108},[296],{"type":30,"value":297},", qualifiedName, e.",{"type":20,"tag":95,"props":299,"children":300},{"style":123},[301],{"type":30,"value":215},{"type":20,"tag":95,"props":303,"children":304},{"style":108},[305],{"type":30,"value":220},{"type":20,"tag":95,"props":307,"children":308},{"class":97,"line":134},[309,314,319,323,328,333,339],{"type":20,"tag":95,"props":310,"children":311},{"style":108},[312],{"type":30,"value":313},"    node.",{"type":20,"tag":95,"props":315,"children":316},{"style":123},[317],{"type":30,"value":318},"put",{"type":20,"tag":95,"props":320,"children":321},{"style":108},[322],{"type":30,"value":199},{"type":20,"tag":95,"props":324,"children":325},{"style":202},[326],{"type":30,"value":327},"\"totalRules\"",{"type":20,"tag":95,"props":329,"children":330},{"style":108},[331],{"type":30,"value":332},", ",{"type":20,"tag":95,"props":334,"children":336},{"style":335},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[337],{"type":30,"value":338},"0",{"type":20,"tag":95,"props":340,"children":341},{"style":108},[342],{"type":30,"value":343},");\n",{"type":20,"tag":95,"props":345,"children":346},{"class":97,"line":153},[347,351,355,359,364,368,372],{"type":20,"tag":95,"props":348,"children":349},{"style":108},[350],{"type":30,"value":313},{"type":20,"tag":95,"props":352,"children":353},{"style":123},[354],{"type":30,"value":318},{"type":20,"tag":95,"props":356,"children":357},{"style":108},[358],{"type":30,"value":199},{"type":20,"tag":95,"props":360,"children":361},{"style":202},[362],{"type":30,"value":363},"\"passedRules\"",{"type":20,"tag":95,"props":365,"children":366},{"style":108},[367],{"type":30,"value":332},{"type":20,"tag":95,"props":369,"children":370},{"style":335},[371],{"type":30,"value":338},{"type":20,"tag":95,"props":373,"children":374},{"style":108},[375],{"type":30,"value":343},{"type":20,"tag":95,"props":377,"children":378},{"class":97,"line":183},[379,383,387,391,396,400,404],{"type":20,"tag":95,"props":380,"children":381},{"style":108},[382],{"type":30,"value":313},{"type":20,"tag":95,"props":384,"children":385},{"style":123},[386],{"type":30,"value":318},{"type":20,"tag":95,"props":388,"children":389},{"style":108},[390],{"type":30,"value":199},{"type":20,"tag":95,"props":392,"children":393},{"style":202},[394],{"type":30,"value":395},"\"failedRules\"",{"type":20,"tag":95,"props":397,"children":398},{"style":108},[399],{"type":30,"value":332},{"type":20,"tag":95,"props":401,"children":402},{"style":335},[403],{"type":30,"value":338},{"type":20,"tag":95,"props":405,"children":406},{"style":108},[407],{"type":30,"value":343},{"type":20,"tag":95,"props":409,"children":410},{"class":97,"line":223},[411,415,419,423,428,432,437],{"type":20,"tag":95,"props":412,"children":413},{"style":108},[414],{"type":30,"value":313},{"type":20,"tag":95,"props":416,"children":417},{"style":123},[418],{"type":30,"value":318},{"type":20,"tag":95,"props":420,"children":421},{"style":108},[422],{"type":30,"value":199},{"type":20,"tag":95,"props":424,"children":425},{"style":202},[426],{"type":30,"value":427},"\"hasFailure\"",{"type":20,"tag":95,"props":429,"children":430},{"style":108},[431],{"type":30,"value":332},{"type":20,"tag":95,"props":433,"children":434},{"style":335},[435],{"type":30,"value":436},"false",{"type":20,"tag":95,"props":438,"children":439},{"style":108},[440],{"type":30,"value":343},{"type":20,"tag":95,"props":442,"children":444},{"class":97,"line":443},7,[445],{"type":20,"tag":95,"props":446,"children":447},{"style":108},[448],{"type":30,"value":229},{"type":20,"tag":21,"props":450,"children":451},{},[452],{"type":30,"value":453},"数据库挂了，返回的是一个格式完全正确、数值全是 0 的对象。前端拿到的就是一张「没有失败规则」的表，健康点亮绿灯，只有日志里留了一行 warn。",{"type":20,"tag":58,"props":455,"children":457},{"id":456},"后端每一段自己报状态",[458],{"type":30,"value":459},"后端：每一段自己报状态",{"type":20,"tag":21,"props":461,"children":462},{},[463,465,471,472,478],{"type":30,"value":464},"新的 ",{"type":20,"tag":34,"props":466,"children":468},{"className":467},[],[469],{"type":30,"value":470},"TableContextService",{"type":30,"value":75},{"type":20,"tag":34,"props":473,"children":475},{"className":474},[],[476],{"type":30,"value":477},"TableContextScope",{"type":30,"value":479}," 枚举选要拉哪几段，首批就是旧 Controller 已有的五段：QUALITY、QUALITY_DETAIL、INCIDENTS、CHANGES、IDE_NODES。每段扔进线程池并行跑，所有段共用一个截止时间，默认 5000ms；逐段收结果的时候，只等离截止时间还剩下的那点时间。",{"type":20,"tag":21,"props":481,"children":482},{},[483,485,491],{"type":30,"value":484},"每段的结果是一个 ",{"type":20,"tag":34,"props":486,"children":488},{"className":487},[],[489],{"type":30,"value":490},"SectionResult",{"type":30,"value":492},"，状态只有三种：OK、TIMEOUT、ERROR。段构建器里吞异常的 try\u002Fcatch 全部删掉，异常一路抛到收集那一层再分类。",{"type":20,"tag":21,"props":494,"children":495},{},[496],{"type":20,"tag":497,"props":498,"children":501},"img",{"alt":499,"src":500},"表上下文服务的收集流程：QUALITY、QUALITY_DETAIL、INCIDENTS、CHANGES、IDE_NODES 五段进入专用线程池 tableContextExecutor（core 8、max 16、queue 16、AbortPolicy），共用默认 5000ms 的截止时间；每段归为 OK（有数据才算，null 归为 ERROR）、TIMEOUT（到截止时间还没回来）或 ERROR（抛异常、返回 null、线程池拒绝，响应里只给异常类名）；响应里多一个 sections 字段，非 OK 的段直接省略对应的键","\u002Fimages\u002Fblog\u002Fgenesis-table-detail\u002Fsection-status.svg",[],{"type":20,"tag":21,"props":503,"children":504},{},[505,507,513],{"type":30,"value":506},"接口对前端保持兼容，原来的键都还在，只多一个顶层的 ",{"type":20,"tag":34,"props":508,"children":510},{"className":509},[],[511],{"type":30,"value":512},"sections",{"type":30,"value":514},"。比如某段超时时：",{"type":20,"tag":85,"props":516,"children":520},{"className":517,"code":518,"language":519,"meta":7,"style":7},"language-json shiki shiki-themes github-light github-dark","\"sections\": { \"quality\": \"TIMEOUT\", \"incidents\": \"OK\", \"changes\": \"OK\" }\n","json",[521],{"type":20,"tag":34,"props":522,"children":523},{"__ignoreMap":7},[524],{"type":20,"tag":95,"props":525,"children":526},{"class":97,"line":98},[527,532,537,542,547,552,556,561,565,570,574,579,583,587],{"type":20,"tag":95,"props":528,"children":529},{"style":202},[530],{"type":30,"value":531},"\"sections\"",{"type":20,"tag":95,"props":533,"children":534},{"style":108},[535],{"type":30,"value":536},": { ",{"type":20,"tag":95,"props":538,"children":539},{"style":335},[540],{"type":30,"value":541},"\"quality\"",{"type":20,"tag":95,"props":543,"children":544},{"style":108},[545],{"type":30,"value":546},": ",{"type":20,"tag":95,"props":548,"children":549},{"style":202},[550],{"type":30,"value":551},"\"TIMEOUT\"",{"type":20,"tag":95,"props":553,"children":554},{"style":108},[555],{"type":30,"value":332},{"type":20,"tag":95,"props":557,"children":558},{"style":335},[559],{"type":30,"value":560},"\"incidents\"",{"type":20,"tag":95,"props":562,"children":563},{"style":108},[564],{"type":30,"value":546},{"type":20,"tag":95,"props":566,"children":567},{"style":202},[568],{"type":30,"value":569},"\"OK\"",{"type":20,"tag":95,"props":571,"children":572},{"style":108},[573],{"type":30,"value":332},{"type":20,"tag":95,"props":575,"children":576},{"style":335},[577],{"type":30,"value":578},"\"changes\"",{"type":20,"tag":95,"props":580,"children":581},{"style":108},[582],{"type":30,"value":546},{"type":20,"tag":95,"props":584,"children":585},{"style":202},[586],{"type":30,"value":569},{"type":20,"tag":95,"props":588,"children":589},{"style":108},[590],{"type":30,"value":591}," }\n",{"type":20,"tag":21,"props":593,"children":594},{},[595,597,602],{"type":30,"value":596},"非 OK 的段不再输出零值对象，直接省略对应的键，状态写在 ",{"type":20,"tag":34,"props":598,"children":600},{"className":599},[],[601],{"type":30,"value":512},{"type":30,"value":603}," 里。",{"type":20,"tag":21,"props":605,"children":606},{},[607],{"type":30,"value":608},"这个服务是按实施计划拆成几个 Task 交给 AI 子代理写的，每个 Task 写完过一轮规格审查和一轮代码质量审查。审查提了好几条，下面这几条是这次改进去的：",{"type":20,"tag":610,"props":611,"children":612},"ul",{},[613,627,654],{"type":20,"tag":614,"props":615,"children":616},"li",{},[617,619,625],{"type":30,"value":618},"异常原文不进响应。原始 message 里可能带着 SQL 和表名，现在返回给调用方的只有异常类名，形如 ",{"type":20,"tag":34,"props":620,"children":622},{"className":621},[],[623],{"type":30,"value":624},"子查询失败: IllegalStateException",{"type":30,"value":626},"，完整堆栈只进日志。",{"type":20,"tag":614,"props":628,"children":629},{},[630,636,638,644,646,652],{"type":20,"tag":34,"props":631,"children":633},{"className":632},[],[634],{"type":30,"value":635},"cancel(true)",{"type":30,"value":637}," 改成 ",{"type":20,"tag":34,"props":639,"children":641},{"className":640},[],[642],{"type":30,"value":643},"cancel(false)",{"type":30,"value":645},"。CompletableFuture 的 cancel 不靠中断线程，传 true 也停不了底层的 JDBC 查询，只是标记这个结果不要了；写成 true 容易让人以为查询被掐掉了。真正给查询设上限要靠 MyBatis 的 ",{"type":20,"tag":34,"props":647,"children":649},{"className":648},[],[650],{"type":30,"value":651},"default-statement-timeout",{"type":30,"value":653},"，那是全局行为，得单独立项。",{"type":20,"tag":614,"props":655,"children":656},{},[657,659,665],{"type":30,"value":658},"OK 段必须有数据，",{"type":20,"tag":34,"props":660,"children":662},{"className":661},[],[663],{"type":30,"value":664},"SectionResult.ok(null)",{"type":30,"value":666}," 直接拒绝。",{"type":20,"tag":21,"props":668,"children":669},{},[670,672,678,680,686],{"type":30,"value":671},"第三条还带出一个新问题。",{"type":20,"tag":34,"props":673,"children":675},{"className":674},[],[676],{"type":30,"value":677},"ok()",{"type":30,"value":679}," 里的 ",{"type":20,"tag":34,"props":681,"children":683},{"className":682},[],[684],{"type":30,"value":685},"requireNonNull",{"type":30,"value":687}," 抛出的 NPE 落在收集方法的 try 块里，三个 catch 一个都接不住，于是只要哪个段构建器返回了 null，整个请求就是 500。复审时改成先判空，null 归为 ERROR：",{"type":20,"tag":85,"props":689,"children":691},{"className":87,"code":690,"language":89,"meta":7,"style":7},"ObjectNode data = future.get(remaining, TimeUnit.NANOSECONDS);\nreturn data == null ? SectionResult.error(\"子查询返回空数据\") : SectionResult.ok(data);\n",[692],{"type":20,"tag":34,"props":693,"children":694},{"__ignoreMap":7},[695,722],{"type":20,"tag":95,"props":696,"children":697},{"class":97,"line":98},[698,703,708,713,717],{"type":20,"tag":95,"props":699,"children":700},{"style":108},[701],{"type":30,"value":702},"ObjectNode data ",{"type":20,"tag":95,"props":704,"children":705},{"style":102},[706],{"type":30,"value":707},"=",{"type":20,"tag":95,"props":709,"children":710},{"style":108},[711],{"type":30,"value":712}," future.",{"type":20,"tag":95,"props":714,"children":715},{"style":123},[716],{"type":30,"value":145},{"type":20,"tag":95,"props":718,"children":719},{"style":108},[720],{"type":30,"value":721},"(remaining, TimeUnit.NANOSECONDS);\n",{"type":20,"tag":95,"props":723,"children":724},{"class":97,"line":114},[725,730,735,740,745,750,755,760,764,769,774,779,783,788],{"type":20,"tag":95,"props":726,"children":727},{"style":102},[728],{"type":30,"value":729},"return",{"type":20,"tag":95,"props":731,"children":732},{"style":108},[733],{"type":30,"value":734}," data ",{"type":20,"tag":95,"props":736,"children":737},{"style":102},[738],{"type":30,"value":739},"==",{"type":20,"tag":95,"props":741,"children":742},{"style":335},[743],{"type":30,"value":744}," null",{"type":20,"tag":95,"props":746,"children":747},{"style":102},[748],{"type":30,"value":749}," ?",{"type":20,"tag":95,"props":751,"children":752},{"style":108},[753],{"type":30,"value":754}," SectionResult.",{"type":20,"tag":95,"props":756,"children":757},{"style":123},[758],{"type":30,"value":759},"error",{"type":20,"tag":95,"props":761,"children":762},{"style":108},[763],{"type":30,"value":199},{"type":20,"tag":95,"props":765,"children":766},{"style":202},[767],{"type":30,"value":768},"\"子查询返回空数据\"",{"type":20,"tag":95,"props":770,"children":771},{"style":108},[772],{"type":30,"value":773},") ",{"type":20,"tag":95,"props":775,"children":776},{"style":102},[777],{"type":30,"value":778},":",{"type":20,"tag":95,"props":780,"children":781},{"style":108},[782],{"type":30,"value":754},{"type":20,"tag":95,"props":784,"children":785},{"style":123},[786],{"type":30,"value":787},"ok",{"type":20,"tag":95,"props":789,"children":790},{"style":108},[791],{"type":30,"value":792},"(data);\n",{"type":20,"tag":58,"props":794,"children":796},{"id":795},"线程池改了三次",[797],{"type":30,"value":795},{"type":20,"tag":21,"props":799,"children":800},{},[801],{"type":30,"value":802},"旧代码没指定线程池，用的是 CompletableFuture 默认的异步执行器。审查意见是：阻塞的 JDBC 查询不该放在那里。",{"type":20,"tag":21,"props":804,"children":805},{},[806,808,814],{"type":30,"value":807},"默认的 commonPool 按 CPU 核数定线程数，是给计算型任务准备的。几个慢查询就能把它占满，别处用到 commonPool 的代码也得跟着等。核数太少时 CompletableFuture 干脆不用 commonPool，每个任务新开一个线程，数量没有上限。哪种都不适合放阻塞查询，于是加了一个专用池 ",{"type":20,"tag":34,"props":809,"children":811},{"className":810},[],[812],{"type":30,"value":813},"tableContextExecutor",{"type":30,"value":815},"。",{"type":20,"tag":21,"props":817,"children":818},{},[819],{"type":30,"value":820},"第一版是 core 4、max 16、queue 100，拒绝策略用 AbortPolicy。这里特意没用 CallerRunsPolicy：队列满了就让提交失败，这一段归为 ERROR 露出来。要是回落到请求线程自己跑，拥塞就被伪装成了「慢」，又是一种假象。",{"type":20,"tag":21,"props":822,"children":823},{},[824],{"type":30,"value":825},"问题出在队列长度上。Spring 的 ThreadPoolTaskExecutor 底下就是 JDK 的 ThreadPoolExecutor，它的规矩是：核心线程满了以后，新任务先进队列，队列满了才会往 max 扩线程。core 4 配 queue 100，要排满 100 个任务才会开第 5 个线程，max 16 和 AbortPolicy 基本等于没配。第二版把队列收到 32。",{"type":20,"tag":21,"props":827,"children":828},{},[829],{"type":30,"value":830},"终审又改了一次。core 4 配 queue 32，并发一上来还是得先排满队列才扩容，排在队列里的段很容易撞上那个共享的 5 秒截止时间，结果就是一批 TIMEOUT。第三版定成 core 8、max 16、queue 16。队列故意留小，并发一来池子就能尽快扩到 16 个线程，任务不至于在队列里一直等到超时：",{"type":20,"tag":85,"props":832,"children":834},{"className":87,"code":833,"language":89,"meta":7,"style":7},"executor.setCorePoolSize(8);\nexecutor.setMaxPoolSize(16);\nexecutor.setQueueCapacity(16);\nexecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.AbortPolicy());\n",[835],{"type":20,"tag":34,"props":836,"children":837},{"__ignoreMap":7},[838,864,889,913],{"type":20,"tag":95,"props":839,"children":840},{"class":97,"line":98},[841,846,851,855,860],{"type":20,"tag":95,"props":842,"children":843},{"style":108},[844],{"type":30,"value":845},"executor.",{"type":20,"tag":95,"props":847,"children":848},{"style":123},[849],{"type":30,"value":850},"setCorePoolSize",{"type":20,"tag":95,"props":852,"children":853},{"style":108},[854],{"type":30,"value":199},{"type":20,"tag":95,"props":856,"children":857},{"style":335},[858],{"type":30,"value":859},"8",{"type":20,"tag":95,"props":861,"children":862},{"style":108},[863],{"type":30,"value":343},{"type":20,"tag":95,"props":865,"children":866},{"class":97,"line":114},[867,871,876,880,885],{"type":20,"tag":95,"props":868,"children":869},{"style":108},[870],{"type":30,"value":845},{"type":20,"tag":95,"props":872,"children":873},{"style":123},[874],{"type":30,"value":875},"setMaxPoolSize",{"type":20,"tag":95,"props":877,"children":878},{"style":108},[879],{"type":30,"value":199},{"type":20,"tag":95,"props":881,"children":882},{"style":335},[883],{"type":30,"value":884},"16",{"type":20,"tag":95,"props":886,"children":887},{"style":108},[888],{"type":30,"value":343},{"type":20,"tag":95,"props":890,"children":891},{"class":97,"line":134},[892,896,901,905,909],{"type":20,"tag":95,"props":893,"children":894},{"style":108},[895],{"type":30,"value":845},{"type":20,"tag":95,"props":897,"children":898},{"style":123},[899],{"type":30,"value":900},"setQueueCapacity",{"type":20,"tag":95,"props":902,"children":903},{"style":108},[904],{"type":30,"value":199},{"type":20,"tag":95,"props":906,"children":907},{"style":335},[908],{"type":30,"value":884},{"type":20,"tag":95,"props":910,"children":911},{"style":108},[912],{"type":30,"value":343},{"type":20,"tag":95,"props":914,"children":915},{"class":97,"line":153},[916,920,925,929,934,939,944],{"type":20,"tag":95,"props":917,"children":918},{"style":108},[919],{"type":30,"value":845},{"type":20,"tag":95,"props":921,"children":922},{"style":123},[923],{"type":30,"value":924},"setRejectedExecutionHandler",{"type":20,"tag":95,"props":926,"children":927},{"style":108},[928],{"type":30,"value":199},{"type":20,"tag":95,"props":930,"children":931},{"style":102},[932],{"type":30,"value":933},"new",{"type":20,"tag":95,"props":935,"children":936},{"style":108},[937],{"type":30,"value":938}," ThreadPoolExecutor.",{"type":20,"tag":95,"props":940,"children":941},{"style":123},[942],{"type":30,"value":943},"AbortPolicy",{"type":20,"tag":95,"props":945,"children":946},{"style":108},[947],{"type":30,"value":220},{"type":20,"tag":21,"props":949,"children":950},{},[951],{"type":20,"tag":497,"props":952,"children":955},{"alt":953,"src":954},"线程池三版对比：每版一条横条，按核心线程直接跑、排队、队列满了才扩到 max、再来就拒绝记 ERROR 四段着色；第一版 core 4、max 16、queue 100，要排满 100 个任务才开第 5 个线程；第二版 core 4、max 16、queue 32，排队的段撞上 5 秒截止时间成批 TIMEOUT；第三版 core 8、max 16、queue 16，队列故意留小，尽快扩到 16 个线程；三版拒绝策略都是 AbortPolicy","\u002Fimages\u002Fblog\u002Fgenesis-table-detail\u002Fpool-versions.svg",[],{"type":20,"tag":21,"props":957,"children":958},{},[959,961,966],{"type":30,"value":960},"有一点要说清楚：",{"type":20,"tag":34,"props":962,"children":964},{"className":963},[],[965],{"type":30,"value":643},{"type":30,"value":967}," 停不了 JDBC，超时的段还会继续占着线程。如果查询一直慢，最终会以 RejectedExecutionException 的形式暴露出来，同样归为 ERROR。这个口子要等语句级超时做了才算真正封上。",{"type":20,"tag":21,"props":969,"children":970},{},[971],{"type":30,"value":972},"审查还记了一条后续项，没放在这次做：质量摘要和质量详情是每条规则单独查一次最新执行记录，一张有 40 条规则的表会先把 QUALITY 段拖到超时，还会挤占后面的段，得改成一次 IN 查询。",{"type":20,"tag":58,"props":974,"children":976},{"id":975},"变红测试",[977],{"type":30,"value":975},{"type":20,"tag":21,"props":979,"children":980},{},[981],{"type":30,"value":982},"这次我最看重的是：失败场景下，状态真的会变红。超时那条测试是这么写的：",{"type":20,"tag":85,"props":984,"children":986},{"className":87,"code":985,"language":89,"meta":7,"style":7},"when(dqRuleMapper.selectList(any())).thenAnswer(inv -> {\n    Thread.sleep(500);\n    return List.of();\n});\nlong start = System.currentTimeMillis();\nMap\u003CTableContextScope, SectionResult> result = service(100)\n        .build(Q_NAME, detail, EnumSet.of(TableContextScope.QUALITY, TableContextScope.INCIDENTS));\nlong elapsed = System.currentTimeMillis() - start;\n\nassertThat(result.get(TableContextScope.QUALITY).status()).isEqualTo(SectionStatus.TIMEOUT);\nassertThat(result.get(TableContextScope.INCIDENTS).status()).isEqualTo(SectionStatus.OK);\nassertThat(elapsed).isLessThan(450);\n",[987],{"type":20,"tag":34,"props":988,"children":989},{"__ignoreMap":7},[990,1041,1067,1090,1098,1129,1177,1204,1244,1254,1297,1335],{"type":20,"tag":95,"props":991,"children":992},{"class":97,"line":98},[993,998,1003,1008,1012,1017,1022,1027,1032,1037],{"type":20,"tag":95,"props":994,"children":995},{"style":123},[996],{"type":30,"value":997},"when",{"type":20,"tag":95,"props":999,"children":1000},{"style":108},[1001],{"type":30,"value":1002},"(dqRuleMapper.",{"type":20,"tag":95,"props":1004,"children":1005},{"style":123},[1006],{"type":30,"value":1007},"selectList",{"type":20,"tag":95,"props":1009,"children":1010},{"style":108},[1011],{"type":30,"value":199},{"type":20,"tag":95,"props":1013,"children":1014},{"style":123},[1015],{"type":30,"value":1016},"any",{"type":20,"tag":95,"props":1018,"children":1019},{"style":108},[1020],{"type":30,"value":1021},"())).",{"type":20,"tag":95,"props":1023,"children":1024},{"style":123},[1025],{"type":30,"value":1026},"thenAnswer",{"type":20,"tag":95,"props":1028,"children":1029},{"style":108},[1030],{"type":30,"value":1031},"(inv ",{"type":20,"tag":95,"props":1033,"children":1034},{"style":102},[1035],{"type":30,"value":1036},"->",{"type":20,"tag":95,"props":1038,"children":1039},{"style":108},[1040],{"type":30,"value":111},{"type":20,"tag":95,"props":1042,"children":1043},{"class":97,"line":114},[1044,1049,1054,1058,1063],{"type":20,"tag":95,"props":1045,"children":1046},{"style":108},[1047],{"type":30,"value":1048},"    Thread.",{"type":20,"tag":95,"props":1050,"children":1051},{"style":123},[1052],{"type":30,"value":1053},"sleep",{"type":20,"tag":95,"props":1055,"children":1056},{"style":108},[1057],{"type":30,"value":199},{"type":20,"tag":95,"props":1059,"children":1060},{"style":335},[1061],{"type":30,"value":1062},"500",{"type":20,"tag":95,"props":1064,"children":1065},{"style":108},[1066],{"type":30,"value":343},{"type":20,"tag":95,"props":1068,"children":1069},{"class":97,"line":134},[1070,1075,1080,1085],{"type":20,"tag":95,"props":1071,"children":1072},{"style":102},[1073],{"type":30,"value":1074},"    return",{"type":20,"tag":95,"props":1076,"children":1077},{"style":108},[1078],{"type":30,"value":1079}," List.",{"type":20,"tag":95,"props":1081,"children":1082},{"style":123},[1083],{"type":30,"value":1084},"of",{"type":20,"tag":95,"props":1086,"children":1087},{"style":108},[1088],{"type":30,"value":1089},"();\n",{"type":20,"tag":95,"props":1091,"children":1092},{"class":97,"line":153},[1093],{"type":20,"tag":95,"props":1094,"children":1095},{"style":108},[1096],{"type":30,"value":1097},"});\n",{"type":20,"tag":95,"props":1099,"children":1100},{"class":97,"line":183},[1101,1106,1111,1115,1120,1125],{"type":20,"tag":95,"props":1102,"children":1103},{"style":102},[1104],{"type":30,"value":1105},"long",{"type":20,"tag":95,"props":1107,"children":1108},{"style":108},[1109],{"type":30,"value":1110}," start ",{"type":20,"tag":95,"props":1112,"children":1113},{"style":102},[1114],{"type":30,"value":707},{"type":20,"tag":95,"props":1116,"children":1117},{"style":108},[1118],{"type":30,"value":1119}," System.",{"type":20,"tag":95,"props":1121,"children":1122},{"style":123},[1123],{"type":30,"value":1124},"currentTimeMillis",{"type":20,"tag":95,"props":1126,"children":1127},{"style":108},[1128],{"type":30,"value":1089},{"type":20,"tag":95,"props":1130,"children":1131},{"class":97,"line":223},[1132,1137,1141,1145,1149,1154,1158,1163,1167,1172],{"type":20,"tag":95,"props":1133,"children":1134},{"style":108},[1135],{"type":30,"value":1136},"Map\u003C",{"type":20,"tag":95,"props":1138,"children":1139},{"style":102},[1140],{"type":30,"value":477},{"type":20,"tag":95,"props":1142,"children":1143},{"style":108},[1144],{"type":30,"value":332},{"type":20,"tag":95,"props":1146,"children":1147},{"style":102},[1148],{"type":30,"value":490},{"type":20,"tag":95,"props":1150,"children":1151},{"style":108},[1152],{"type":30,"value":1153},"> result ",{"type":20,"tag":95,"props":1155,"children":1156},{"style":102},[1157],{"type":30,"value":707},{"type":20,"tag":95,"props":1159,"children":1160},{"style":123},[1161],{"type":30,"value":1162}," service",{"type":20,"tag":95,"props":1164,"children":1165},{"style":108},[1166],{"type":30,"value":199},{"type":20,"tag":95,"props":1168,"children":1169},{"style":335},[1170],{"type":30,"value":1171},"100",{"type":20,"tag":95,"props":1173,"children":1174},{"style":108},[1175],{"type":30,"value":1176},")\n",{"type":20,"tag":95,"props":1178,"children":1179},{"class":97,"line":443},[1180,1185,1190,1195,1199],{"type":20,"tag":95,"props":1181,"children":1182},{"style":108},[1183],{"type":30,"value":1184},"        .",{"type":20,"tag":95,"props":1186,"children":1187},{"style":123},[1188],{"type":30,"value":1189},"build",{"type":20,"tag":95,"props":1191,"children":1192},{"style":108},[1193],{"type":30,"value":1194},"(Q_NAME, detail, EnumSet.",{"type":20,"tag":95,"props":1196,"children":1197},{"style":123},[1198],{"type":30,"value":1084},{"type":20,"tag":95,"props":1200,"children":1201},{"style":108},[1202],{"type":30,"value":1203},"(TableContextScope.QUALITY, TableContextScope.INCIDENTS));\n",{"type":20,"tag":95,"props":1205,"children":1207},{"class":97,"line":1206},8,[1208,1212,1217,1221,1225,1229,1234,1239],{"type":20,"tag":95,"props":1209,"children":1210},{"style":102},[1211],{"type":30,"value":1105},{"type":20,"tag":95,"props":1213,"children":1214},{"style":108},[1215],{"type":30,"value":1216}," elapsed ",{"type":20,"tag":95,"props":1218,"children":1219},{"style":102},[1220],{"type":30,"value":707},{"type":20,"tag":95,"props":1222,"children":1223},{"style":108},[1224],{"type":30,"value":1119},{"type":20,"tag":95,"props":1226,"children":1227},{"style":123},[1228],{"type":30,"value":1124},{"type":20,"tag":95,"props":1230,"children":1231},{"style":108},[1232],{"type":30,"value":1233},"() ",{"type":20,"tag":95,"props":1235,"children":1236},{"style":102},[1237],{"type":30,"value":1238},"-",{"type":20,"tag":95,"props":1240,"children":1241},{"style":108},[1242],{"type":30,"value":1243}," start;\n",{"type":20,"tag":95,"props":1245,"children":1247},{"class":97,"line":1246},9,[1248],{"type":20,"tag":95,"props":1249,"children":1251},{"emptyLinePlaceholder":1250},true,[1252],{"type":30,"value":1253},"\n",{"type":20,"tag":95,"props":1255,"children":1257},{"class":97,"line":1256},10,[1258,1263,1268,1272,1277,1282,1287,1292],{"type":20,"tag":95,"props":1259,"children":1260},{"style":123},[1261],{"type":30,"value":1262},"assertThat",{"type":20,"tag":95,"props":1264,"children":1265},{"style":108},[1266],{"type":30,"value":1267},"(result.",{"type":20,"tag":95,"props":1269,"children":1270},{"style":123},[1271],{"type":30,"value":145},{"type":20,"tag":95,"props":1273,"children":1274},{"style":108},[1275],{"type":30,"value":1276},"(TableContextScope.QUALITY).",{"type":20,"tag":95,"props":1278,"children":1279},{"style":123},[1280],{"type":30,"value":1281},"status",{"type":20,"tag":95,"props":1283,"children":1284},{"style":108},[1285],{"type":30,"value":1286},"()).",{"type":20,"tag":95,"props":1288,"children":1289},{"style":123},[1290],{"type":30,"value":1291},"isEqualTo",{"type":20,"tag":95,"props":1293,"children":1294},{"style":108},[1295],{"type":30,"value":1296},"(SectionStatus.TIMEOUT);\n",{"type":20,"tag":95,"props":1298,"children":1300},{"class":97,"line":1299},11,[1301,1305,1309,1313,1318,1322,1326,1330],{"type":20,"tag":95,"props":1302,"children":1303},{"style":123},[1304],{"type":30,"value":1262},{"type":20,"tag":95,"props":1306,"children":1307},{"style":108},[1308],{"type":30,"value":1267},{"type":20,"tag":95,"props":1310,"children":1311},{"style":123},[1312],{"type":30,"value":145},{"type":20,"tag":95,"props":1314,"children":1315},{"style":108},[1316],{"type":30,"value":1317},"(TableContextScope.INCIDENTS).",{"type":20,"tag":95,"props":1319,"children":1320},{"style":123},[1321],{"type":30,"value":1281},{"type":20,"tag":95,"props":1323,"children":1324},{"style":108},[1325],{"type":30,"value":1286},{"type":20,"tag":95,"props":1327,"children":1328},{"style":123},[1329],{"type":30,"value":1291},{"type":20,"tag":95,"props":1331,"children":1332},{"style":108},[1333],{"type":30,"value":1334},"(SectionStatus.OK);\n",{"type":20,"tag":95,"props":1336,"children":1338},{"class":97,"line":1337},12,[1339,1343,1348,1353,1357,1362],{"type":20,"tag":95,"props":1340,"children":1341},{"style":123},[1342],{"type":30,"value":1262},{"type":20,"tag":95,"props":1344,"children":1345},{"style":108},[1346],{"type":30,"value":1347},"(elapsed).",{"type":20,"tag":95,"props":1349,"children":1350},{"style":123},[1351],{"type":30,"value":1352},"isLessThan",{"type":20,"tag":95,"props":1354,"children":1355},{"style":108},[1356],{"type":30,"value":199},{"type":20,"tag":95,"props":1358,"children":1359},{"style":335},[1360],{"type":30,"value":1361},"450",{"type":20,"tag":95,"props":1363,"children":1364},{"style":108},[1365],{"type":30,"value":343},{"type":20,"tag":21,"props":1367,"children":1368},{},[1369],{"type":30,"value":1370},"截止时间设成 100ms，让质量段睡 500ms。断言质量段是 TIMEOUT、Incident 段还是 OK，而且整个 build 不到 450ms 就返回，说明它没有傻等慢的那段。",{"type":20,"tag":21,"props":1372,"children":1373},{},[1374,1376,1382],{"type":30,"value":1375},"另一条让 mapper 抛 ",{"type":20,"tag":34,"props":1377,"children":1379},{"className":1378},[],[1380],{"type":30,"value":1381},"IllegalStateException(\"db down\")",{"type":30,"value":1383},"，断言状态是 ERROR、data 为空、message 里有异常类名，但没有 db down 这几个字。超时、异常、空数据、线程池拒绝四类失败都有对应的测试，后端测试从 387 个涨到 414 个。",{"type":20,"tag":58,"props":1385,"children":1387},{"id":1386},"前端接上段状态又翻出六处断链",[1388],{"type":30,"value":1389},"前端：接上段状态，又翻出六处断链",{"type":20,"tag":21,"props":1391,"children":1392},{},[1393,1395,1401,1403,1408],{"type":30,"value":1394},"后端说实话了，前端还会接着骗人。",{"type":20,"tag":34,"props":1396,"children":1398},{"className":1397},[],[1399],{"type":30,"value":1400},"HealthIndicator.vue",{"type":30,"value":1402}," 原来只在质量和 Incident 两段都缺的时候才显示灰色；质量超时、Incident 正常，照样是绿灯。所以前端必须读 ",{"type":20,"tag":34,"props":1404,"children":1406},{"className":1405},[],[1407],{"type":30,"value":512},{"type":30,"value":815},{"type":20,"tag":21,"props":1410,"children":1411},{},[1412],{"type":30,"value":1413},"排查时我是读代码，再用 grep 反查每个调用点，结果又翻出六处早就存在的断链。挑三处说：",{"type":20,"tag":610,"props":1415,"children":1416},{},[1417,1446,1489],{"type":20,"tag":614,"props":1418,"children":1419},{},[1420,1422,1428,1430,1436,1438,1444],{"type":30,"value":1421},"质量 Tab 永远显示「该表未绑定质量规则」。页面传给它的是 ",{"type":20,"tag":34,"props":1423,"children":1425},{"className":1424},[],[1426],{"type":30,"value":1427},"fullData?.quality",{"type":30,"value":1429},"，这是摘要，没有 ",{"type":20,"tag":34,"props":1431,"children":1433},{"className":1432},[],[1434],{"type":30,"value":1435},"rules",{"type":30,"value":1437}," 数组，而组件用 ",{"type":20,"tag":34,"props":1439,"children":1441},{"className":1440},[],[1442],{"type":30,"value":1443},"!qualityData.rules",{"type":30,"value":1445}," 判空。有规则的表也显示未绑定。",{"type":20,"tag":614,"props":1447,"children":1448},{},[1449,1451,1456,1458,1464,1466,1472,1473,1479,1481,1487],{"type":30,"value":1450},"运行 Tab 渲染出三张空卡片。传进去的是整个 ",{"type":20,"tag":34,"props":1452,"children":1454},{"className":1453},[],[1455],{"type":30,"value":39},{"type":30,"value":1457}," 响应，",{"type":20,"tag":34,"props":1459,"children":1461},{"className":1460},[],[1462],{"type":30,"value":1463},"runData.incidents",{"type":30,"value":1465}," 成了对象 ",{"type":20,"tag":34,"props":1467,"children":1469},{"className":1468},[],[1470],{"type":30,"value":1471},"{activeCount, hasActiveFailure, incidents:[…]}",{"type":30,"value":815},{"type":20,"tag":34,"props":1474,"children":1476},{"className":1475},[],[1477],{"type":30,"value":1478},"incidents.length === 0",{"type":30,"value":1480}," 永远不成立，",{"type":20,"tag":34,"props":1482,"children":1484},{"className":1483},[],[1485],{"type":30,"value":1486},"v-for",{"type":30,"value":1488}," 遍历的是这个对象的三个值。",{"type":20,"tag":614,"props":1490,"children":1491},{},[1492,1494,1500,1502,1507,1509,1515],{"type":30,"value":1493},"非项目成员在运行 Tab 看到「暂无活跃故障」。组件判断的是 ",{"type":20,"tag":34,"props":1495,"children":1497},{"className":1496},[],[1498],{"type":30,"value":1499},"runData.authorized === false",{"type":30,"value":1501},"，可 ",{"type":20,"tag":34,"props":1503,"children":1505},{"className":1504},[],[1506],{"type":30,"value":39},{"type":30,"value":1508}," 返回的字段叫 ",{"type":20,"tag":34,"props":1510,"children":1512},{"className":1511},[],[1513],{"type":30,"value":1514},"hasPermission",{"type":30,"value":1516},"。没权限被显示成了一切正常。",{"type":20,"tag":21,"props":1518,"children":1519},{},[1520,1522,1528,1530,1536,1538,1544,1546,1552,1554,1560],{"type":30,"value":1521},"另外三处是：关联 IDE 节点区块永远为空，因为 ",{"type":20,"tag":34,"props":1523,"children":1525},{"className":1524},[],[1526],{"type":30,"value":1527},"getTableRunStatus",{"type":30,"value":1529}," 只有定义没有调用点；从深链 ",{"type":20,"tag":34,"props":1531,"children":1533},{"className":1532},[],[1534],{"type":30,"value":1535},"?tab=run-status",{"type":30,"value":1537}," 进来不加载数据，因为 ",{"type":20,"tag":34,"props":1539,"children":1541},{"className":1540},[],[1542],{"type":30,"value":1543},"watch(activeTab)",{"type":30,"value":1545}," 没加 ",{"type":20,"tag":34,"props":1547,"children":1549},{"className":1548},[],[1550],{"type":30,"value":1551},"immediate",{"type":30,"value":1553},"；切换表时沿用上一张表的健康数据，因为 ",{"type":20,"tag":34,"props":1555,"children":1557},{"className":1556},[],[1558],{"type":30,"value":1559},"loadFullData()",{"type":30,"value":1561}," 开头写着「已有数据就直接返回」。",{"type":20,"tag":21,"props":1563,"children":1564},{},[1565,1567,1573,1575,1581],{"type":30,"value":1566},"查到底才发现，给两个 Tab 准备的懒加载端点 ",{"type":20,"tag":34,"props":1568,"children":1570},{"className":1569},[],[1571],{"type":30,"value":1572},"\u002Fquality-status",{"type":30,"value":1574},"、",{"type":20,"tag":34,"props":1576,"children":1578},{"className":1577},[],[1579],{"type":30,"value":1580},"\u002Frun-status",{"type":30,"value":1582}," 一直都在，响应形状和组件的 props 完全对得上，组件本来就是照着它们写的，只是装载层从来没接上。所以前端这一步主要是接线：两个 Tab 改接各自的端点，组件对数据形状再做一层防御，以后再错配也只会退化成空态，不会渲染出乱码。几个加载函数都加了请求代次守卫：请求发出时记下是哪张表，结果回来时要是已经切到别的表，就把这份结果丢掉。快速切表时，旧请求晚回来的结果不会盖住新表的数据。",{"type":20,"tag":21,"props":1584,"children":1585},{},[1586],{"type":30,"value":1587},"健康点的判定改成已知异常优先：",{"type":20,"tag":21,"props":1589,"children":1590},{},[1591],{"type":20,"tag":497,"props":1592,"children":1595},{"alt":1593,"src":1594},"健康点判定顺序：先问有没有活跃失败，有就判红；再问有没有失败规则或活跃 Incident，有就判黄，缺了某一段也照样判黄；再问质量或运行是不是有一段没取到，是就判灰，提示质量数据暂不可用、无法判定健康状态；都没有才是绿；变更段不参与判定","\u002Fimages\u002Fblog\u002Fgenesis-table-detail\u002Fhealth-rule.svg",[],{"type":20,"tag":21,"props":1597,"children":1598},{},[1599,1601,1606],{"type":30,"value":1600},"有活跃失败是红，有失败规则或活跃 Incident 是黄；没有已知异常，但质量或运行有一段没取到，就判灰，提示写「质量数据暂不可用，无法判定健康状态」。缺一段，不能把另一段确实红了的情况盖掉。变更段不参与健康判定。两个 Tab 在段失败时显示「暂不可用」，不再显示「未绑定规则」或「暂无活跃故障」。",{"type":20,"tag":34,"props":1602,"children":1604},{"className":1603},[],[1605],{"type":30,"value":39},{"type":30,"value":1607}," 整个请求失败时显示「加载失败」，审查之前这种情况会被说成无权限。前端测试从 113 个到 133 个。",{"type":20,"tag":58,"props":1609,"children":1611},{"id":1610},"还没做完的",[1612],{"type":30,"value":1610},{"type":20,"tag":21,"props":1614,"children":1615},{},[1616,1618,1623],{"type":30,"value":1617},"这次的证据是单测、类型检查和构建。后端那部分我没在 devbox 上起整套服务做冒烟：当时手上没有一套和生产隔离的后端环境，后端一起来，定时轮询、发布对账和 Flyway 迁移都会去碰生产，这不是一个重构任务能擅自做的事。当时定的是等下次生产部署后，用只读请求核一遍 ",{"type":20,"tag":34,"props":1619,"children":1621},{"className":1620},[],[1622],{"type":30,"value":512},{"type":30,"value":1624},"，前端的运行时核验也一起放到那时候。",{"type":20,"tag":21,"props":1626,"children":1627},{},[1628,1630,1635,1637,1643],{"type":30,"value":1629},"还有两个尾巴。",{"type":20,"tag":34,"props":1631,"children":1633},{"className":1632},[],[1634],{"type":30,"value":39},{"type":30,"value":1636}," 里的 changes 段前端没人渲染，",{"type":20,"tag":34,"props":1638,"children":1640},{"className":1639},[],[1641],{"type":30,"value":1642},"\u002Fide-nodes",{"type":30,"value":1644}," 端点也没有调用方，要么接到「最近变更」区块，要么删掉。段状态现在只有三态，查到了但确实没有数据的情况也算 OK，前端只能靠约定区分，后面想在后端补一个 EMPTY。",{"type":20,"tag":1646,"props":1647,"children":1648},"style",{},[1649],{"type":30,"value":1650},"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);}",{"title":7,"searchDepth":134,"depth":134,"links":1652},[1653,1654,1655,1656,1657,1658],{"id":60,"depth":114,"text":60},{"id":456,"depth":114,"text":459},{"id":795,"depth":114,"text":795},{"id":975,"depth":114,"text":975},{"id":1386,"depth":114,"text":1389},{"id":1610,"depth":114,"text":1610},"markdown","content:blog:2026-09-09-genesis-table-detail-truth.md","content","blog\u002F2026-09-09-genesis-table-detail-truth.md","blog\u002F2026-09-09-genesis-table-detail-truth","md",[1666,1669],{"_path":1667,"title":1668},"\u002Fblog\u002F2026-09-12-genesis-lakehouse-hudi-iceberg","给 Genesis 接 Hudi 和 Iceberg：灰度怎么设计，canary 卡在了哪",{"_path":1670,"title":1671},"\u002Fblog\u002F2026-09-06-gmall-dw-on-genesis","在 Genesis 上一夜搭完电商数仓 V6，路上记下 30 个问题",1796523532783]