-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
perf(link): optimize concurrent response #641
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
Conversation
|
如果跨多个组件,请使用主要组件作为前缀,并在标题中枚举、描述中说明。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This performance optimization pull request optimizes concurrent response link handling by implementing proper resource management for link objects and refactoring range reading interfaces. The changes improve memory efficiency and prevent resource leaks through systematic use of defer statements for closing links.
Key changes include:
- Implementing consistent resource cleanup with
defer link.Close()across multiple handlers - Refactoring
RangeReadCloserinterface to useRangeReaderfor better abstraction - Adding reference counting for shared link resources to support concurrent access safely
Reviewed Changes
Copilot reviewed 78 out of 78 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| server/webdav/webdav.go | Added defer link.Close() calls for proper resource cleanup |
| server/handles/*.go | Standardized link resource management with defer statements |
| server/s3/backend.go | Refactored to use new RangeReader interface with proper cleanup |
| pkg/utils/io.go | Enhanced Closers implementation with sync support and reference counting |
| internal/stream/util.go | Replaced RangeReadCloser with RangeReader interface |
| internal/model/args.go | Updated Link struct to use RangeReader and added Close method |
| drivers/* | Updated driver configurations to use new field names |
Comments suppressed due to low confidence (1)
server/s3/backend.go:145
- [nitpick] The parameter name 's3Obj' is inconsistent with the original 'obj' name and could be confusing. Consider using a more descriptive name like 'object' or keeping the original 'obj' name.
func (b *s3Backend) GetObject(ctx context.Context, bucketName, objectName string, rangeRequest *gofakes3.ObjectRangeRequest) (s3Obj *gofakes3.Object, err error) {
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com>
* fix(crypt): bug caused by link cache * perf(crypt,mega,halalcloud,quark,uc): optimize concurrent response link * chore: 删除无用代码 * ftp * 修复bug;资源释放 * 添加SyncClosers * local,sftp,smb * 重构,优化,增强 * Update internal/stream/util.go Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com> * chore * chore * 优化,修复bug * . --------- Signed-off-by: j2rong4cn <36783515+j2rong4cn@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.