Please confirm the following
OpenList Version
Current main branch.
Storage Driver Used
SMB
Bug Description
When using an SMB storage as the source and copying many files from OpenList to another cloud storage, Windows 11 Pro keeps accumulating SMB sessions from the OpenList host. Once Windows reaches its 20-session limit, all subsequent files that have not started copying fail with:
Failed load storage: failed init storage: No more connections can be made to this remote computer at this time because the computer has already accepted the maximum number of connections.
On the Windows 11 Pro SMB server, net session shows 20 active sessions. After copy traffic stops, waiting several hours does not release those sessions automatically.
This is related to #2228, but that report was closed as invalid because of the issue template checkbox. This issue adds a more specific reproduction path and root-cause analysis.
Root Cause
The SMB driver currently keeps only *smb2.Share and calls Share.Umount() when dropping or refreshing the connection. However, cloudsoda/go-smb2 models SMB cleanup in layers:
- open files need
File.Close();
- mounted shares need
Share.Umount();
- authenticated sessions need
Session.Logoff().
Because OpenList does not keep the *smb2.Session, it cannot call Session.Logoff(). During long or repeated transfer workloads, old SMB sessions can remain open on the Windows server even after the share is unmounted locally.
Long-running transfers also make this easier to trigger: Link() opens an SMB file stream, but later operations may decide the shared SMB connection is stale because lastConnTime was only updated when the link was created, not while the file is still being read.
Expected Behavior
OpenList should close SMB files, unmount the share, and log off the SMB session. Long-running downloads/uploads/copies should keep the current SMB session alive until the transfer stream closes, so background refresh logic does not replace the session while it is still in use.
Reproduction
- Configure Windows 11 Pro as an SMB server.
- Mount that SMB share in OpenList.
- Copy many files from the SMB storage to another cloud storage through OpenList.
- Watch
net session on Windows.
- The session count grows to 20.
- Remaining files fail with the Windows connection limit error.
- Stop traffic and wait several hours.
- The 20 sessions remain until they are manually deleted, for example with
net session \\<client-ip> /delete, or the server is restarted.
Logs
No more connections can be made to this remote computer at this time because the computer has already accepted the maximum number of connections.
Proposed Fix
Keep the SMB session in the driver, call Session.Logoff() during cleanup, and protect active transfers from idle reconnect logic until their streams are closed.
Please confirm the following
mainbranch.OpenList Version
Current
mainbranch.Storage Driver Used
SMB
Bug Description
When using an SMB storage as the source and copying many files from OpenList to another cloud storage, Windows 11 Pro keeps accumulating SMB sessions from the OpenList host. Once Windows reaches its 20-session limit, all subsequent files that have not started copying fail with:
On the Windows 11 Pro SMB server,
net sessionshows 20 active sessions. After copy traffic stops, waiting several hours does not release those sessions automatically.This is related to #2228, but that report was closed as invalid because of the issue template checkbox. This issue adds a more specific reproduction path and root-cause analysis.
Root Cause
The SMB driver currently keeps only
*smb2.Shareand callsShare.Umount()when dropping or refreshing the connection. However,cloudsoda/go-smb2models SMB cleanup in layers:File.Close();Share.Umount();Session.Logoff().Because OpenList does not keep the
*smb2.Session, it cannot callSession.Logoff(). During long or repeated transfer workloads, old SMB sessions can remain open on the Windows server even after the share is unmounted locally.Long-running transfers also make this easier to trigger:
Link()opens an SMB file stream, but later operations may decide the shared SMB connection is stale becauselastConnTimewas only updated when the link was created, not while the file is still being read.Expected Behavior
OpenList should close SMB files, unmount the share, and log off the SMB session. Long-running downloads/uploads/copies should keep the current SMB session alive until the transfer stream closes, so background refresh logic does not replace the session while it is still in use.
Reproduction
net sessionon Windows.net session \\<client-ip> /delete, or the server is restarted.Logs
Proposed Fix
Keep the SMB session in the driver, call
Session.Logoff()during cleanup, and protect active transfers from idle reconnect logic until their streams are closed.