Notepad3 icon indicating copy to clipboard operation
Notepad3 copied to clipboard

Accessing LAN files will freeze when the other party is offline

Open nil-ref opened this issue 2 years ago • 6 comments

When I use notepad3 to open a file (smb) on the LAN, the other party is offline. Notepad3 will be stuck for more than ten seconds because it constantly detects whether the file has changed.

nil-ref avatar Nov 07 '23 03:11 nil-ref

Hello @nil-ref ,

Which version of Notepad3 are you using, as recent versions may have fixed this issue. 🤔

  • Go to tab "Help"
  • Open "About..." (Shift+F11)
  • Push on button "Copy Version Text"

This copy the Notepad3 related settings to the clipboard and permit to past the content here. 🙄

Have you tried with latest Notepad3 beta (see issue #1129)

hpwamr avatar Nov 07 '23 09:11 hpwamr

The latest version: Notepad3 (x64) 6.23.1020.1 rc (05a5eafc)

nil-ref avatar Nov 08 '23 03:11 nil-ref

default settings.

nil-ref avatar Nov 10 '23 09:11 nil-ref

The quick solution would be: switch off "file changed monitoring" for SMB file share. Notepad3 relies on two mechanisms for file change monitoring:

  1. Concurrently running monitoring thread, pushing events to check for file change if directory signals some change.
  2. File changed polling every n milliseconds (default 2000ms) Maybe 1.) is problematic on SMB network shares. Solution could be: options to choose between 1.) , 2.) or both (current default).

RaiKoHoff avatar Nov 17 '23 01:11 RaiKoHoff

The cause of the problem lies in calling APIs such as GetFileAttributes that need to open files. These functions ultimately go through IopCreateFile->ObOpenObjectByName. However, they do not support asynchronous opening of files. Always wait/freeze when they go through the "\??\UNC\" NT path.

https://stackoverflow.com/questions/1142080/how-to-avoid-network-stalls-in-getfileattributes https://stackoverflow.com/questions/41300873/how-to-open-a-file-in-windows-asynchronously

Windows can't open a file asynchronously. Maybe this problem can only be solved using threads.

nil-ref avatar Nov 19 '23 02:11 nil-ref

@nil-ref : Thanks for providing this interesting readings on Stackoverflow - always a good source of expert knowledge. I am going to give it a try ..., needs some time ...

RaiKoHoff avatar Nov 20 '23 23:11 RaiKoHoff