fix: accept concurrent SFTP session channels#321
Open
metabrixkt wants to merge 1 commit into
Open
Conversation
Previously, Wings handled each accepted SFTP session channel synchronously inside the SSH channel loop. This blocked the server from accepting additional session channels on the same SSH connection until the active SFTP session ended (which may not happen until the client disconnects). Some clients, such as GVFS, open multiple SFTP session channels over a single SSH connection during mount setup. With the accept loop blocked, GVFS would wait for the additional channel to be accepted before timing out and falling back. Now, each accepted session channel is handled in its own goroutine, so SSH session channel multiplexing works as expected. After the SSH channel stream closes, `AcceptInbound` waits for active session handlers before returning.
0fb7746 to
c1c4e01
Compare
Author
|
Rebased following the release of v1.12.3 |
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.
What was wrong?
Previously, Wings handled each accepted SFTP session channel synchronously inside the SSH channel loop. This blocked the server from accepting additional session channels on the same SSH connection until the active SFTP session ended (which may not happen until the client disconnects).
What's the impact?
Some clients, such as GVFS, open multiple SFTP session channels over a single SSH connection during mount setup. With the accept loop blocked, GVFS would wait for the additional channel to be accepted before timing out and falling back.
The change
This change handles each accepted session channel in its own goroutine, allowing SSH session channel multiplexing to work as expected.
In local testing, this reduced GVFS mount setup time from about 40 seconds to under a second 👀