fix(smb): close smb sessions during transfers#2579
Open
shoyuf wants to merge 1 commit into
Open
Conversation
Co-authored-by: Codex <codex@openai.com> Signed-off-by: shoyuf <shoyuf@shoyuf.top>
117c61c to
ce34736
Compare
xrgzs
requested changes
Jun 4, 2026
Author
There was a problem hiding this comment.
Don't commit this file.
sorry, I forgot this
fdc6f0a to
ce34736
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary / 摘要
Fix SMB session lifecycle handling during long transfers.
Store the
*smb2.Sessionin the SMB driver so cleanup can callSession.Logoff(), not onlyShare.Umount().Add connection leases around SMB operations so idle refresh does not replace a session while a file stream, upload, or same-storage copy is still active.
Keep the SMB download lease alive until the returned
Linkstream is closed.Log off partially initialized sessions if
Mountfails afterDialsucceeds.This PR has breaking changes.
This PR changes public API, config, storage format, or migration behavior.
This PR requires corresponding changes in related repositories.
Related repository PRs:
Related Issues / 关联 Issue
Fixes #2578
Related to #2228
Testing / 测试
gofmt drivers/smb/driver.go drivers/smb/util.goGOCACHE=/private/tmp/openlist-go-build-cache GOMODCACHE=/private/tmp/openlist-go-mod-cache GOPROXY=https://goproxy.cn,direct go test ./drivers/smbgo test ./...go test ./...was attempted, but unrelated existing packages fail:non-constant format stringdiagnostics;pkg/aria2/rpcexpects a local aria2 RPC server atlocalhost:6800.The SMB package itself compiles successfully.
Checklist / 检查清单
gofmt.AI Disclosure / AI 使用声明
Tools used / 使用工具:
Usage scope / 使用范围:
Code generation / 代码生成
Refactoring / 重构
Documentation / 文档
Tests / 测试
Review assistance / 审查辅助
I have reviewed and validated all AI-assisted content included in this PR.
I have ensured that all AI-assisted commits include
Co-Authored-Byattribution.I can reproduce all AI-assisted content included in this PR without any AI tools.