{"record":{"id":"430c5883eed1fa45","repo":"jd-opensource/joyagent-jdgenie","slug":"filter-column-request-id-error-msg","errorCode":null,"errorMessage":"[filter column] {request_id} 多次重试后执行失败, error_msg:{error_msg}","messagePattern":"\\[filter column\\] (.+?) 多次重试后执行失败, error_msg:(.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"genie-tool/genie_tool/tool/table_rag/table_column_filter.py","lineNumber":263,"sourceCode":"                            column_index = column_info.get(\"columnIndex\", \"\")\n                            default_recall = column_info.get(\"defaultRecall\", 0)\n                            \n                            if column_index in result_column_indexes or default_recall == 1:\n                                filter_columns.append(column_info)\n                        \n                        table_schema_info[\"schemaList\"] = filter_columns\n                        return table_schema_info\n                    else:\n                        return None\n                \n                except Exception as e:\n                    error_msg = f\"第{retry + 1}次执行结果:\\n{llm_response}，报错信息:{e}\"\n                    \n                    traceback.print_exc()\n                    logger.error(f\"[filter column] {request_id}, fail to filter columns error_msg {error_msg}\")\n                    continue\n            \n            raise RuntimeError(f\"[filter column] {request_id} 多次重试后执行失败, error_msg:{error_msg}\")\n    \n    async def batch_get_stage_result(self):\n        # table_schema_lists = self.body.get(\"schema_info\", [])\n        table_schema_lists = self.column_info\n        \n        if not table_schema_lists:\n            return []\n        \n        # 第一阶段：批处理过滤（粗筛）\n        batch_size = self.table_filter_batch_size  # 增大 batch 提高吞吐\n        semaphore1 = asyncio.Semaphore(self.table_filter_batch_size)\n        \n        # 流式生成 batch\n        def batch_generator():\n            for i in range(0, len(table_schema_lists), batch_size):\n                yield table_schema_lists[i:i + batch_size]\n        \n        # 异步执行所有 batch，流式获取完成结果","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/jd-opensource/joyagent-jdgenie/blob/2417e0b8b636d941ad5fb14c59b20dddfef5375d/genie-tool/genie_tool/tool/table_rag/table_column_filter.py#L245-L281","documentation":"_filter_single_table raises RuntimeError after exhausting all retries when LLM-based column filtering never produced a parseable result. error_msg holds the last failure's LLM response and exception, so the root cause is usually error 102 (unparseable JSON) repeated on every retry.","triggerScenarios":"All retry attempts inside _filter_single_table fail (each attempt's exception is logged and the loop continues); after the final attempt the last error_msg is wrapped and raised. Called by batch_get_stage_result and batch_get_result.","commonSituations":"Persistent LLM output-format drift across retries; LLM endpoint timeouts or 429/5xx errors on every attempt; retry count too low for a flaky endpoint; prompt consistently yields non-JSON answers.","solutions":["Inspect error_msg in the message: if it is a format issue fix the prompt/parser (see 解析llm json结果失败); if a network issue fix connectivity/rate limits","Increase the retry count and add exponential backoff between attempts","Validate/repair the LLM response between retries (strip fences, retry only the failing table)","Reduce concurrency (semaphore) or request size if the endpoint is rate-limiting under batch load"],"exampleFix":"// before\nfor retry in range(max_retries):\n    try:\n        return parse(llm_call(...))\n    except Exception as e:\n        error_msg = f\"...\"\n        continue\nraise RuntimeError(f\"[filter column] {request_id} 多次重试后执行失败, error_msg:{error_msg}\")\n// after\nfor retry in range(max_retries):\n    try:\n        return parse(llm_call(...))\n    except Exception as e:\n        error_msg = f\"...\"\n        await asyncio.sleep(2 ** retry)\n        continue\nlogger.error(f\"[filter column] {request_id} final failure: {error_msg}\")\nraise RuntimeError(f\"[filter column] {request_id} 多次重试后执行失败, error_msg:{error_msg}\")","handlingStrategy":"retry","validationCode":"# before batching, smoke-test one table\nsample = await _filter_single_table(sem, table_schema_lists[0])\nif sample is None:\n    raise RuntimeError('column filter pipeline unhealthy; fix prompt/endpoint before batching')","typeGuard":null,"tryCatchPattern":"try:\n    result = await batch_get_result(request)\nexcept RuntimeError as e:\n    if '多次重试后执行失败' in str(e):\n        save_partial_results_and_alert(request, str(e))","preventionTips":["Add exponential backoff between retries","Monitor LLM endpoint error/latency rates","Keep a per-table partial-results fallback","Set retry count relative to endpoint reliability"],"tags":["llm","retry","rag"],"backgroundTag":"request-timeout","analyzedSha":"2417e0b8b636d941ad5fb14c59b20dddfef5375d","analyzedAt":"2026-09-08T11:28:19.414Z","contentChangedAt":"2026-09-08T11:28:19.414Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}