-
-
Notifications
You must be signed in to change notification settings - Fork 931
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
Rebased AsyncResult fix #1184
Rebased AsyncResult fix #1184
Conversation
d7688de
to
90e848b
Compare
90e848b
to
6b1595b
Compare
I am seeing strange failures of this test locally. The failures are not the original "uploaded/downloaded bytes do not match" assertion, rather some kind of channel closed/timeout exception such as "Renci.SshNet.Common.SshOperationTimeoutException: Session operation has timed out". I thought I had narrowed it down and was able to reproduce the behaviour, but then it started behaving differently and now I have no idea what's going on. |
Can you remove this in this PR SSH.NET/test/Renci.SshNet.IntegrationTests/OldIntegrationTests/SftpClientTest.Upload.cs Line 236 in 9b0262c
|
- AsyncResult should contain invalid value immediately after async operation is marked as completed - there was race condition problems with callback method which is invoked on different thread so updating of value is done without any synchronization. So in some cases async operation is marked as completed but async result value is not yet updated and contains invalid value
c0fd3df
to
8b21031
Compare
Thanks, I had done that locally but forgot to push... |
@Rob-Hague It looks like it works. Is it ready for review? |
Yes I think so, I think there were gremlins in my PC |
This is #680 by @miroslavpokorny brought up to date.
I have been seeing occasional failures of the
Test_Sftp_Multiple_Async_Upload_And_Download_10Files_5MB_Each
test.When choosing "Run until failure" in Visual Studio, the test failed after 20, 9, 45, 32 and 10 attempts. With this change, it ran successfully over 300 times before I stopped it.
Fixes #329
Side note: I'm not really sure why these Begin/End methods have an extra "callback" parameter as well as an
AsyncCallback
parameter, but I'm hoping we can just get rid of these methods soon anyway, or at least have them wrap a task based implementation