forked from notepad-plus-plus/notepad-plus-plus
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix network files hanging while the network disconnected (part 4)
Fix network file hanging issue due to win32API GetFileAttributes cache (unsynchronized). STR: 1. Open a network file. 2. Close Notepad++ to have it in the session. 3. Disconnect the network, and launch Notepad++ immediately. 4. Around more than 1 minute's delay, then the "Error" dialog displayed. The reason of hanging is that the network file was detected by "doesFileExist" as true, so Notepad++ was trying to open non-existent file (by _wfopen). I believe that there's some kind of cache during the very short period for the IO function (here's our case GetFileAttributes), and such cache is not immediately synchronized (cleared) while network disconnected. As a result, when we launch Notepad++ after the disconnection of network, GetFileAttributes keeps its memory & responds "FileExists". However for _wfopen it can't find the resource of network anymore - that makes hanging. Ref: notepad-plus-plus#15658 (comment) Improve notepad-plus-plus#4306, notepad-plus-plus#6178, notepad-plus-plus#8055, notepad-plus-plus#11388, notepad-plus-plus#12553, notepad-plus-plus#15540
- Loading branch information
Showing
3 changed files
with
115 additions
and
16 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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