8000 fix race w/ open packet and stat by eikenb · Pull Request #266 · pkg/sftp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix race w/ open packet and stat #266

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

Merged
merged 1 commit into from
Aug 22, 2018
Merged

fix race w/ open packet and stat #266

merged 1 commit into from
Aug 22, 2018

Conversation

eikenb
Copy link
Member
@eikenb eikenb commented Aug 20, 2018

An Open packet would trigger the use of a worker pool, then the Stat
packet would come in go to the pool and return faster than the Open
(returning a file-not-found error). This fixes that be eliminating the
pool/non-pool state switching.

The included test doesn't really exercise it fully as it cannot inject
a delay in the right place to trigger the race. I plan on adding a means
to inject some logic into the packet handling in the future once I
rewrite the old filesystem server code as a request-server backend.

Fixes #265

@eikenb eikenb mentioned this pull request Aug 20, 2018
An Open packet would trigger the use of a worker pool, then the Stat
packet would come in go to the pool and return faster than the Open
(returning a file-not-found error). This fixes that be eliminating the
pool/non-pool state switching.

The include test doesn't really exercise it fully as it cannot inject
a delay in the right place to trigger the race. I plan on adding a means
to inject some logic into the packet handling in the future once I
rewrite the old filesystem server code as a request-server backend.

Fixes #265
@eikenb eikenb merged commit 718e647 into master Aug 22, 2018
@eikenb eikenb deleted the issue265 branch August 22, 2018 20:22
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.

Is SSHFS supported?
1 participant
0