Skip to content

Conversation

@j2rong4cn
Copy link
Member

@j2rong4cn j2rong4cn commented Aug 4, 2025

主要修改

  • 优化ftp驱动并发响应Link
  • 修复alias驱动并发响应Link返回MFile时被共享(MFile线程不安全)
  • 修复local驱动缩略图返回RangeReaderk大小不正确

@j2rong4cn j2rong4cn marked this pull request as draft August 4, 2025 18:27
* 解决alias并发响应时Link返回MFile线程不安全
@j2rong4cn j2rong4cn marked this pull request as ready for review August 5, 2025 13:00
@j2rong4cn j2rong4cn marked this pull request as draft August 5, 2025 13:31
@j2rong4cn
Copy link
Member Author

太乱了,

@j2rong4cn j2rong4cn closed this Aug 6, 2025
@j2rong4cn j2rong4cn reopened this Aug 6, 2025
@j2rong4cn j2rong4cn changed the title perf(ftp): optimize concurrent response perf(ftp): improve concurrent Link response; fix alias/local driver issues Aug 6, 2025
@j2rong4cn j2rong4cn marked this pull request as ready for review August 6, 2025 03:53
@SenkjM SenkjM requested a review from Copilot August 6, 2025 03:57
Copy link
Contributor

Copilot AI left a 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 PR focuses on performance improvements for the FTP driver and fixes thread-safety issues in the alias and local drivers related to Link responses. The changes optimize concurrent Link handling while addressing issues with shared MFile objects that are not thread-safe.

  • Optimizes FTP driver concurrent Link responses by removing custom FileReader and using direct range requests
  • Fixes alias driver concurrent Link responses to prevent shared MFile thread-safety issues
  • Corrects local driver thumbnail RangeReader size handling

Reviewed Changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
pkg/utils/io.go Refactors SyncClosers to use atomic operations and removes redundant error handling in CopyWithBuffer
internal/stream/util.go Simplifies GetRangeReaderFromMFile to return proper interface type
internal/stream/stream.go Refactors RangeReadReadAtSeeker to use sync.Map and simplifies caching logic
internal/op/fs.go Adds MFile caching prevention logic for concurrent Link requests
internal/model/args.go Removes redundant Close method from Link struct
drivers/ftp/driver.go Completely rewrites FTP Link implementation for better concurrency
drivers/local/driver.go Fixes ContentLength assignment for thumbnails
drivers/alias/driver.go Adds proper Link copying to prevent shared MFile issues
Multiple driver files Various cleanups and optimizations

- Return actual error instead of nil in stream range read failure
- Fix buffer copy bounds to prevent out-of-range access
- Improve FTP FileReader loop termination and error propagation
- Ensure partial reads are properly handled with context cancellation
Copy link
Contributor

@Suyunmeng Suyunmeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Suyunmeng Suyunmeng merged commit 9ac0484 into OpenListTeam:main Aug 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants