dubbo-go-bot opened a new pull request, #798: URL: https://github.com/apache/dubbo-go-pixiu/pull/798
## 🔄 Upstream Sync from Community Fork This PR automatically syncs changes from the community fork to the upstream repository. ### Original Contribution - **Author**: @Alanxtl - **Original PR**: https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/12 - **Merged at**: 2025-11-07 04:43:45 UTC ### Original PR Description --- ### **User description** improve error handling by aggregating problems during retries ___ ### **PR Type** Bug fix, Enhancement ___ ### **Description** - Aggregate all errors during retry attempts using `errors.Join` - Track problems from retry policy loading, request assembly, and network failures - Initialize endpoint metadata and context params maps to prevent nil pointer errors - Replace unused context parameter with blank identifier ___ ### Diagram Walkthrough ```mermaid flowchart LR A["Retry Loop"] --> B["Collect Errors"] B --> C["Policy Load Error"] B --> D["Request Assembly Error"] B --> E["Network Error"] B --> F["Status Code Error"] C --> G["Aggregate with errors.Join"] D --> G E --> G F --> G G --> H["Return Combined Error"] ``` <details> <summary><h3> File Walkthrough</h3></summary> <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Error handling</strong></td><td><table> <tr> <td> <details> <summary><strong>filter.go</strong><dd><code>Aggregate retry errors and prevent nil pointer panics</code> </dd></summary> <hr> pkg/filter/llm/proxy/filter.go <ul><li>Added <code>problems</code> slice to collect all errors during retry attempts<br> <li> Initialize <code>endpoint.Metadata</code> and <code>executor.hc.Params</code> maps to prevent <br>nil pointer errors<br> <li> Append errors to <code>problems</code> slice for retry policy, request assembly, <br>network, and status code failures<br> <li> Replace final error return with <code>errors.Join(problems...)</code> to aggregate <br>all collected errors<br> <li> Replace unused <code>ctx</code> parameter with blank identifier in <br><code>PrepareFilterChain</code></ul> </details> </td> <td><a href="https://github.com/dubbo-go-pixiu/dubbo-go-pixiu/pull/12/files#diff-37d19eb2e8a72025536b0a071b33558ce790bee9fbe05d43c62c7b7c5194b10a">+16/-4</a> </td> </tr> </table></td></tr></tr></tbody></table> </details> ___ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Prevents rare crashes by validating request metadata and parameters before use. * Marks failing endpoints as temporarily unhealthy after exhausting retries, improving reliability and failover behavior. * **Refactor** * Consolidates all retry and fallback failures into a single aggregated error, providing clearer diagnostics when requests ultimately fail. * Records detailed failure context during retry attempts to aid troubleshooting without altering successful response behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- All commits preserve original authorship. **Note**: Auto-created when PR #12 was merged into `dubbo-go-pixiu/dubbo-go-pixiu:develop`. cc @Alanxtl -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
