-
Notifications
You must be signed in to change notification settings - Fork 668
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
insufficient system resources exist to complete the requested service #1058
Comments
Hi @onexzero , Where does "insufficient system resources exist to complete the requested service" appears ? |
Hi @Liryna |
When an error occurs, notepad becomes unresponsive for a long time (about 20 seconds or more) and then appears in notepad.exe. |
But in version 1.5.1000 it doesn't appear at all. Even though the source code is the same... |
Well you and I are not able to reproduce with the sample so I cannot do much here. |
Looking at the log, the QueryStandardInformationFile call caused that error and there is no error for that call on the server either. Moreover, there is no code that can cause LOCK. |
If LOCK occurs somewhere and the error is caused, the test was performed more than 200 times in the 1.5.1000-based driver, wouldn't it have to occur at least once? But it's strange that it happens so often in 2.XX. There is currently no way other than to check further. Thanks for the reply. |
Let me know if you are able to get more information on the issue that points to dokan and I will be glad to look into it. |
I replaced notepad.exe with notepad++ and tested it and the error does not occur. It seems to have something to do with the notepad's memory-mapped-io. |
We'll let you know if I find anything odd. |
I think I found the cause of the problem by tracing GetStandardInformationFile. If you look at the attached image cause-pmon.png, the GetStandardInformationFile call started at 12:56:48 at the time of the error, and the Dokan log (cause-dokan.png) shows that GetFileInformation was received at 12:57:07. Also, when the server got the call (serverlog.png) it says 12:57:08 seconds. From this you can see that most of the time was spent before GetFileInformation was called. This seems to be what caused that error. |
Thanks for the logs. Indeed there is something odd here. The pulling of new events is taking way longer than expected
|
Sorry for the late reply because I was sleeping. |
Without a repro It is going to be very difficult to debug this. Could you please share with details how to get into this state with the samples ? |
There is no special way. It is very difficult to reproduce with sample provided. I attached log reproduced with my own driver. |
When driver log activated, it rarely occurs in my own driver also. But without /e switch it occurs very often. |
@onexzero Can you repro with you filesystem with the single thread mode ? |
Maybe it's possible. I'll try it. |
This is the single-threaded test result. Reproduced using the supplied Mirror sample. |
For reference, this is the result of my driver. |
You can easily reproduce below command. |
I can see there is something weird in the logs but I am not able to reproduce even with this command line 😢 |
That's really a strange phenomenon. I have not installed anything in Windows except ms-office. |
We are trying to find one of those logs Lines 636 to 702 in 6bd609b
|
Mount the drive and log until an error occurs. Usually, it's reproduced after about five attempts. But I can't see the message on the source. |
Profiling report collected on real machine. |
Profiling result on VM |
@onexzero I pushed new changes that overall improves the read and write scenario. |
Ok. I'll test it. |
@onexzero There is no version. All changes are in the library. You can just pull the new changes and build if you want to test them. |
Ok. I'll test it. |
Excellent work! Performance has improved remarkably. I've tested several things and haven't found any issues yet. |
Thanks for the feedback @onexzero 👍 Glad we got it solved! |
@Liryna hi~ |
The driver logs looks fine. The Create request around before the gap between 26 and 38 are completed at 26 and we see the library logs. The Create failing with Can this be repro with samples ? on any computers ? |
It's very difficult to reproduce with a sample, but I'll give it a try. |
Even if the result looks the same, I am not able to see the same trace/events in the driver logs. |
All operations before and after INSUFFICIENT_RESOURCES were taking a long time to complete. CloseFile also took 18 seconds. What was the cause? I checked the server side logs, but couldn't find the part that took that long. It looks like there is some kind of problem with LOCK. |
From the logs you provided, the close happens in the library at the right time. When you say lock issue it is a guess or you located it? |
C:\Users\raccoon\Desktop\mirror>mirror /r C:\Users\raccoon\Desktop\Temp /l r /e /d /n \localhost\dokan Contrary to what I thought, it was reproduced well with the Dokan sample. |
Regarding LOCK, it's just speculation. It's just a feeling, so don't worry too much. |
Same result on local drive emulation mode. |
I think I've found a pattern for this problem. |
In programs that retry when an error occurs, such as Windows movie player, responsiveness can be improved by adjusting the timeout value of DokanOption and the value of dokan_check_interval, but it is still a problem in programs that immediately popup errors such as Notepad.exe. It seems that we need to find the root cause of the INSUFFICIENT_RESOURCE problem. |
Finally found the root cause. The pull thread count is set too low. When I edit the source in 4-Core VM and take a log, it comes out as 2. I don't think this was originally intended. I forced it to 8 and the problem went away. |
Normally we should detect your 4 Core and set 4 threads https://github.com/dokan-dev/dokany/blob/master/dokan/dokan.c#L778-L783 |
Matching the number of threads to the number of cores may seem ideal, but according to actual test results, it is not enough. That is, the error occurs intermittently even when set to 4-thread. I think several factors such as core speed are related to this problem. How about making it configurable as in the previous version? |
@onexzero I think the issue might be different. Could you reset all your local changes and give a try to a31981d ? |
Could you provide the exact app, windows version and steps so I can reproduce the issue on my side ? It would be interesting to know whether it is canceled by Line 32 in 6bd609b
or Line 329 in e9f4bef
because is does not looks like it is a timeout if you can make the create return faster by changing the DOKAN_CHECK_INTERVAL Unfortunately there is no logs in those functions 😢 (Also if you add logs there, they might not be forward to userland, it would need to have the "real" debugger attach to see them) Do you see this log in your system EventLog Line 255 in 2352816
|
Windows 10 pro 32bit 19044 (run on 4-Core VM)
"Wake from sleep detected." was not found in the event log. The attempt to improve response time by reducing DOKAN_CHECK_TIME and Timeout was based on the following log. Results are already at #1058 (comment)
|
Feature request can skip this form. Bug report must complete it.
Check List
must be 100% match or it will be automatically closed without further discussion. Please remove this line.Environment
Check List
Description
"insufficient system resources exist to complete the requested service" appears when opening .txt file with notepad.
I ran mirror.exe without /n switch as follow.
mirror.exe /r C:\Users\raccoon\Desktop\temp /l r:
And that message appeared low probability(about 1/15) when I did open /close repeatedly.
So i tested again with dokany 1.5.1 but It worked well even on more slow my own driver with /n switch.
No such message poped up.
I tested dokany latest version various way. and found that it's more faster than 1.5.x. So I planed to migrate to latest version but this problem occured again.
And the ms-office crashing problem a few days ago I issued is solved. Root cause is that dokanOperations.FindStreams returns STATUS_SUCCESS when did not implemented, this makes powerpoint-crash on save or save-as. I think it should be fixed.
And now my driver works well on dokany 2.0.1.2000 except this problem.
Logs
Please attach in separate files: mirror output, library logs and kernel logs.
In case of BSOD, please attach minidump or dump analyze output.
The text was updated successfully, but these errors were encountered: