shell OOM #93
Reference in New Issue
Block a user
Delete Branch "registry-alpha"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary by CodeRabbit
Bug Fixes
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.
📝 Walkthrough
Walkthrough
The changes modify error handling in the GitHub proxy flow for shell scripts—when smart processing fails, the handler now returns a Bad Gateway error instead of falling back to original content. Additionally, shell processing utilities are refactored to operate on byte slices, accept
io.Readerinstead ofio.ReadCloser, introduce a 10 MB size limit, and improve error propagation.Changes
src/handlers/github.gosrc/utils/proxy_shell.goMaxShellSize(10 MB); changesProcessSmartandreadShellContentsignatures to acceptio.Readerinstead ofio.ReadCloser; refactors content handling to operate on byte slices; introduces size-limiting logic; converts content type checks from string-based tobytes.Contains; enhances gzip decompression handlingEstimated code review effort
🎯 3 (Moderate) | ⏱️ ~22 minutes
Poem
🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands and usage tips.Actionable comments posted: 1
🧹 Nitpick comments (1)
📜 Review details
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between
c6d95e683fand685388fff9.📒 Files selected for processing (2)
src/handlers/github.gosrc/utils/proxy_shell.go🔇 Additional comments (4)
@@ -177,3 +176,4 @@return}// 智能设置响应头⚠️ Potential issue | 🟡 Minor
🧩 Analysis chain
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 1228
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 365
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 87
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 3571
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 78
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 1526
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 680
🏁 Script executed:
Repository: sky22333/hubproxy
Length of output: 3210
Consider differentiating error handling by error type.
The error handling treats all ProcessSmart errors uniformly (returning 502). Since different failures have different implications—size limit exceeded (the OOM prevention goal) versus transient decompression or read errors—consider whether transient errors warrant different treatment such as retry logic or fallback behavior, while size-limit errors appropriately trigger 502.