-
Notifications
You must be signed in to change notification settings - Fork 54
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
Write operations seem to be hanging #12
Comments
You're right - the latest changes that were introduced to support filesystems with "immutable" files (read: MEGA) seem to have broken something. |
The crux of the problem seems to be that in Dokan Operations set allocation Size
and the content is never copied from the Dokan context stream to the scatterStream so everything is blank :) |
Could you please check if my latest checkin to the develop branch does any good for your problem? With the fix applied I was able to write a ~12Mb binary file to a FILE based volume, verify its CRC while on the mounted volume and copy it back to a normal HD intact. |
I will check however I should have clarified before I am using the library with the encryption key set to "" which, I understood, would bypass the encryption all together, I am wondering if this could also account for the problems I am seeing |
You are correct in assuming that BTW, do you access your mounted cloud volume through Windows Explorer or directly from .NET code? My primary design goal for DokanCloudFS has been to enable cloud access for Windows Explorer, so there is a chance that not all code paths are covered for "raw" .NET - although this will definitely work for the CloudFS gateways. |
I access the mounted cloud volume via windows Explorer, I am still seeing issues with writes after the changes. I wonder if the proxy file creation could be interfering as that seems to be a fairly recent change. the reason I mentioned the SetAllocation is that I am seeing scenarios where Write is called before set allocation and as far as I can tell that written content would not end up in the scatterstream. |
That's interesting. I've not seen this behavior so far. IIRC the only case where Do you have a specific scenario that I could try to reproduce, like
|
I was testing with small files.. but in those cases the file save hangs. |
Ok, bad habit. I just saw that your reply came between my original comment and my edits. |
Sorry about that. My setup is windows 8.1 and windows 10 I am using BTSYNC that is selectively syncing files from a remote share but as far as access goes all my reads and writes are local and I am not seeing file access issues. |
…d.exe) Handle encryted files with unknown encryption key as raw file
Please verify if #9c11912 improves anything. |
These are tests with small files. 1: So new file saving no longer hangs but the files are written to the disk and then immediately are removed 2: If you attempt to open an existing txt file and then attempt to save it an error is thrown as the driver attempts to use the original stream that only has read permissions when using the file sample cloud disk saving a file now returns a permissions error Attached are the two log files from my notepad test with my virtual drive "CloudShare" and the "File" for this test I literally started the drive, |
Thanks very much for this detailed report - I now understand the reason behind your observed errors much better. |
Ok, most of your simple test scenario should work now:
Thanks again for your cooperation, @adamrogas. Please feel free to report any additional shortcomings or to close this issue if there are none. |
So I just tested this, the problem of initial writing seems to have been resolved. but if I open a file in notepad, and type some changes and hit save or close it immediately comes back with "Invalid Parameter"..... at first glance it looks like what is really happening is the write cant access the file because the read already has the file open and has not released the file yet. this error then cascades down and ultimately the driver attempts to remove the file for some reason :) which luckily it can't for the same reason, "The File is locked" I have included a screen shot of my system during this error, which gives a surprising amount of detail. I have the call stack visible as well as the locals where you can see the error message, |
Nice shot. But why do you think the amount of detail to be surprising? |
The reason for the driver trying to remove a file when errors occur (except In the presence of unrecoverable write errors in the cloud (use of a fully transactional file system is ruled out for the time being) I'd rather have a file missing entirely in my backup than keeping a corrupt copy. Especially when considering that there is no such thing as a partially corrupt file with AES encryption. But I'd be interested in your view on this matter. Maybe there are other cases than authorization failure that can be compensated without purging the target file. |
On the file deleting Now from the perspective of a remote file system view for backups this makes tons of sense. In an interactive view of a file system this is incredibly dangerous. On the open then save issue In the case of this driver being a proxy in the middle that is no longer the case and that is where a majority of the file issues are coming from in the dokan projects that are actually proxing file system access. |
I totally agree with your view. What I'd like to do is identify better those situations when "nothing about the file has changed" so there is no danger of the file having gotten corrupted by a partial write. I started checking for
You sound like you have run into some painful issues with Dokan in the past :-(. I'm basically aware of the implications behind read/write file access contention. However, I have so far failed in tracking down the actual reason for this contention to occur in DokanCloudFS. Whenever I break into the debugger in Annoying case of Heisenbug - maybe related to a threading issue. |
Also, I have so far only observed the contention for the local |
I thought about writing a file manager that was responsible for all of the actual io that gave out handles to to the processes as they were accessing the files, the theory is that the same process doesn't have to abide by the locking even if it's in conflict so it never really comes up for these apps when they are working with the disk directly. So no file close until there are zero handles and everything else would be virtual. -Adam Sent from my iPhone
|
Understood, it's a fairly unique use case. Sent from my iPhone
|
…ion with HResult == 0x80070020 is thrown
… if the first call throws an IOException with HResult == 0x80070020
Nevertheless I may have found an ugly workaround - at least it worked for me in about 10 consecutive manual tests. |
…chance FileInfo.OpenWrite call to 1 ms
… if the first call throws an IOException with HResult == 0x80070020
…chance FileInfo.OpenWrite call to 1 ms
Hi @adamrogas, have you had a chance to check if the latest changes to CloudFS - or version 1.0.6-alpha for that matter - fixed your situation? |
It seems that the problem is still present while saving the MS Office files (.docx file opened - trying to save changes, two temporary files created by MS Word) - tested with Box. There is no problem with classic Text files. Exception occurs in Read method of ScatterStream class (during the SetAllocationSize dokan operation). |
- ScatterStream extended to support Read() - ScatterStream/GatherStream extended to support setting of Capacity MS Word can now save documents directly into a cloud volume, **however**, files in the .docx format end up corrupted.
Hi @drunkenbeaver, made some headway with the MS Office file handling issue. Maybe someone with deeper knowledge of the inner workings of MS Office file operations can help out: What is it that MS Word expects the file system to do after it saves (and apparently verifies by re-reading) a temporary |
Hi there! First of all, I'm really happy that you still actively maintain this code base and I look forward to switch to develop branch to check out the latest progress on this and relevant issues. This is what I've found MS is doing while Opening, Saving or Closing it's documents (.docx eg.) where Word.docx is a sample file I'm working with: Open Word.docx
Save Word.docx
Close Word.docx
You're probably familiar with this or similar scenario. It's quite difficult to track what's happening here, especially if at the endpoint you're trying to version these documents (ofc, original Word.docx is actually the only file that's really of interest to the users). |
Hi @drunkenbeaver, your helicopter view of MS Word's file operations is certainly correct. At this level of detail I have been able to perform the steps until
At this point, MS Word initiates a series of Apart from that I have tracked down the error you reported back in December, so you'll at least be able to save a .docx file under a different name with the next DokanCloudFS release. |
I am seeing odd behavior and was wondering if anyone else was as well,
When testing my CloudFS plugin, that was based heavily on the FILE plugin write operations are hanging and never completing.
anytime the content.CopyTo(stream) is being called the program hangs.
It appears that for some reason the Dokan stream is never actually getting copied to the GatherStream because assigned blocks is always empty and so GetAvailableBytes is coming back as 0.
As a sanity check I also attached the original untouched FILE plugin and had similar results.
has anything changed that could be affecting this ?
The text was updated successfully, but these errors were encountered: