[9.21a] TC hangs for a while if remote PC disconnected
Moderators: Hacker, petermad, Stefan2, white
[9.21a] TC hangs for a while if remote PC disconnected
I think there is a something that I've reported in the past, but the problem remains.
I have opened some shared folders from different virtual PCs, and these may be inavailable or go to sleep, so connection may be lost. When I switch to a tab with such disconnected share (or activate TC with such share in current tab, or close current tab and another tab with such share becomes active), TC tries to restore connection, takes some time to show me login/password window, I press Cancel because all I want at this time is to open some other directory, but this one just bothers me instead, and TC hangs for a minute or two, if I click its window it becomes a ghost window, and I only have to wait or kill it and restart in order to open required folder faster. Most often such situation happens in the morning when virtual PCs are still idle.
It seems that there is a logic that handles such remote connections that is still not in background, so it would be great to finally move it into background. All logic that requests some tab contents should be in the background to avoid freezing entire TC window, and any tab should be closable (in such case awaiting thread should be stopped in the background).
I have opened some shared folders from different virtual PCs, and these may be inavailable or go to sleep, so connection may be lost. When I switch to a tab with such disconnected share (or activate TC with such share in current tab, or close current tab and another tab with such share becomes active), TC tries to restore connection, takes some time to show me login/password window, I press Cancel because all I want at this time is to open some other directory, but this one just bothers me instead, and TC hangs for a minute or two, if I click its window it becomes a ghost window, and I only have to wait or kill it and restart in order to open required folder faster. Most often such situation happens in the morning when virtual PCs are still idle.
It seems that there is a logic that handles such remote connections that is still not in background, so it would be great to finally move it into background. All logic that requests some tab contents should be in the background to avoid freezing entire TC window, and any tab should be closable (in such case awaiting thread should be stopped in the background).
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [9.21a] TC hangs for a while if remote PC disconnected
Unfortunately I do not have this problem. TC should show a "connecting" dialog after about 5 seconds. Could you check with process monitor from sysinternals where it hangs?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [9.21a] TC hangs for a while if remote PC disconnected
Yes, indeed it shows Connecting dialog, but it blocks TC window so I can't switch to another tab and open desired folder w/o waiting, and when I cancel connecting, it hangs.
I've checked with Process Monitor, after cancelling Connecting dialog TC have spent 34 seconds in CreateFile on remote folder (within FindFirstFileW call according to the stack) with DISCONNECTED result code, and there was no way to prevent it, TC had a ghost window. According to the list of threads FindFirstFileW happens in main TC thread (start address is the entry point).
Having separate threads for different tabs at least for non-local locations would improve overall stability very much. And, it would be nice to have Connecting dialog locking only its tab, not entire TC.
I've checked with Process Monitor, after cancelling Connecting dialog TC have spent 34 seconds in CreateFile on remote folder (within FindFirstFileW call according to the stack) with DISCONNECTED result code, and there was no way to prevent it, TC had a ghost window. According to the list of threads FindFirstFileW happens in main TC thread (start address is the entry point).
Having separate threads for different tabs at least for non-local locations would improve overall stability very much. And, it would be nice to have Connecting dialog locking only its tab, not entire TC.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [9.21a] TC hangs for a while if remote PC disconnected
TC calls FindFirstFileW in a background thread - this shouldn't hang the masin process...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [9.21a] TC hangs for a while if remote PC disconnected
But for some strange reason it freezes it, and it looks like it calls it from main thread...
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [9.21a] TC hangs for a while if remote PC disconnected
Could you produce a stack trace with "WhatIsHang", please?
http://www.nirsoft.net/utils/what_is_hang.html
http://www.nirsoft.net/utils/what_is_hang.html
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [9.21a] TC hangs for a while if remote PC disconnected
Unfortunately it isn't easy to reproduce it at any time, I've just tried but with no luck. I'll try to get such trace when this will happen again.
Re: [9.21a] TC hangs for a while if remote PC disconnected
I've sent you some kind of hang report to support email, please check it. In the morning, I've checked all tabs with remote shares and found one that displayed a Connecting dialog but when I've cancelled it, TC have hung for 20-30 seconds with a ghost window.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [9.21a] TC hangs for a while if remote PC disconnected
Thanks, I will analyze it. Please also send me a report if you can reproduce the original problem.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [9.21a] TC hangs for a while if remote PC disconnected
The problem which caused your report should be fixed in Total Commander 9.22 release candidate 1, please test it!
You may still get hangs in other places. If you do, please send me again a hang report.
You may still get hangs in other places. If you do, please send me again a hang report.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [9.21a] TC hangs for a while if remote PC disconnected
Thank you, I hope it will work fine. 
Since it is hard to reproduce the bug at any time, testing may have some time, I'll report if I find any hangs.

Since it is hard to reproduce the bug at any time, testing may have some time, I'll report if I find any hangs.
- ghisler(Author)
- Site Admin
- Posts: 50541
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [9.21a] TC hangs for a while if remote PC disconnected
Thanks, that would be nice!
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com