-
Notifications
You must be signed in to change notification settings - Fork 3k
Feat 6567 memory leak #6571
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Feat 6567 memory leak #6571
Conversation
WalkthroughAdds memory optimization infrastructure to HTTP protocol handling, including verbose target tracking, hash-based body representation for large responses exceeding thresholds, and dynamic body read size limits. These changes prevent memory exhaustion when processing large HTTP responses during template scanning. Changes
Sequence DiagramsequenceDiagram
participant Client
participant Request as request.go
participant VerboseReg as Verbose Registry
participant HTTP as http.go
participant Operators as operators.go
Client->>Request: Execute HTTP request
Request->>VerboseReg: MarkVerboseTarget(url)
Request->>Request: Read response with conditional size limit
Request->>HTTP: CheckAndMarkVerbose(response)
HTTP->>HTTP: Check Content-Length vs Threshold
alt Content-Length exceeds threshold
HTTP->>VerboseReg: MarkVerboseTarget(url)
end
Request->>Operators: Build DSL with response & body
Operators->>HTTP: IsVerboseTarget(url)?
alt Body size > HashThreshold
Operators->>Operators: Use hash marker instead of full body
else Body size ≤ HashThreshold
Operators->>Operators: Use full body string
end
Operators->>Client: Return optimized DSL map
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🧰 Additional context used📓 Path-based instructions (2)**/*.go📄 CodeRabbit inference engine (CLAUDE.md)
Files:
pkg/protocols/**/*.go📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (4)📓 Common learnings📚 Learning: 2025-07-16T21:27:14.937ZApplied to files:
📚 Learning: 2025-06-30T16:34:42.125ZApplied to files:
📚 Learning: 2025-09-05T14:23:55.257ZApplied to files:
🧬 Code graph analysis (3)pkg/protocols/http/request.go (1)
pkg/protocols/http/http.go (1)
pkg/protocols/http/operators.go (3)
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. Comment |
Proposed changes
Closes #6567
Checklist
Summary by CodeRabbit
Performance
Refactor