86.0b1+ have been taking a long time to shut down when exiting the program. nsMsgAccountManager::CleanupOnExit with server setting "empty trash on exit" enabled
Categories
(Thunderbird :: General, defect)
Tracking
(Not tracked)
People
(Reporter: thee.chicago.wolf, Unassigned)
References
Details
(Keywords: perf)
I've noticed that in the past few betas---maybe since about 86?---when I File > Exit or click the close button {X] in the top right corner, it takes about 10+ seconds before TB actually exits and isn't shown as running in the Task Manager.
Any way I could help by running some kind of shutdown hang monitor/detector?
Reporter | ||
Comment 2•4 years ago
|
||
Just tried to see if there's anything in Error Console with 89.0b3 and not seeing anything that jumps out. Seems that between 89.0b1 (when I filed this bug) and 89.0b3 this hang behavior has decreased. I timed a shutdown and it now takes between 3-4 seconds as opposed to the 10 seconds or so it did before.
I tried a few times to close TB and immediately start it and a couple times I get the "Thunderbird is already running...." window which prompts to Close or Cancel. Only thing I saw in Error Console when I did this was:
NotFoundError: Could not open the file at C:\Users\<removed>\AppData\Local\Thunderbird\Profiles\23lp3mw9.default\startupCache\webext.sc.lz4 ExtensionParent.jsm:1758
_readData resource://gre/modules/ExtensionParent.jsm:1758
AsyncFunctionThrow self-hosted:699
So the only sort of STR I can state is:
- With TB closed (verify via Task Manager), launch it
- As soon as the TB window appears, close it via [X] immediately and quickly try to relaunch it again
This is the only way I can reliably repro (at home) the "Thunderbird is already running...." window that I would get when I closed it normally. I realize this is not the best method since no one would normally do this type of behavior but it's the best I got right now.
Comment 3•3 years ago
|
||
Are you still seeing this?
Reporter | ||
Comment 4•3 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #3)
Are you still seeing this?
Yes, but it's improved since the 86+ betas. I'm on 93.0b5 now. On my home PC it takes about 6-7 seconds to disappear from the Task Manager from the time I close TB. I feel like in the 60/70 TB days, it disappeared from Task Manager within a few seconds.
If I close TB and launch it immediately, Error Console shows:
mail.activity: Exception: [Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource:///modules/ActivityManager.jsm :: getActivity :: line 135" data: no] ActivityManager.jsm:86:16
removeActivity resource:///modules/ActivityManager.jsm:86
onFolderRemovedFromQ resource:///modules/activity/autosync.jsm:247
NS_ERROR_NOT_AVAILABLE: ActivityManager.jsm:135
getActivity resource:///modules/ActivityManager.jsm:135
removeActivity resource:///modules/ActivityManager.jsm:84
onFolderRemovedFromQ resource:///modules/activity/autosync.jsm:247
And I can always tell TB didn't shut down properly yet because the little left-to-right-to-left animation beneath "File" and above "Get Messages" is going. After a proper shutdown and subsequent launch, that animation disappears after a few seconds.
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Have you tested this with both WIndows and Thunderbird in safe mode?
Beyond that, it would be useful to determine the regression range using mozregression tool against nightly builds.
Reporter | ||
Comment 6•3 years ago
|
||
I have tested in safe mode with the same results but am currently battling a major issue in 95.0b4 / b5:
bp-9c3c2ba0-b1bc-49cc-b4f4-04d491211202 16 hours ago
bp-686ddf04-cf70-4afe-be60-667181211202 16 hours ago
bp-2b340fd8-7a30-4349-8d19-7f1ac1211202 16 hours ago
bp-e2827d65-f3ce-4057-a6c8-e50831211202 18 hours ago
bp-80febe58-46c0-4d45-a50c-4bc9e1211202 20 hours ago
bp-32d8118c-4d09-40df-8b3b-13b461211202 24 hours ago
bp-aeede7ac-4aa7-495a-b14f-94df61211201 2 days ago
bp-96e5b05b-aad2-48e7-98ac-c26781211201 2 days ago
bp-6993f892-19da-4fa1-afe1-343191211201 2 days ago
bp-e7b9076f-c768-4174-a096-da5cd1211201 2 days ago
bp-59edd26c-d014-4b45-818a-b95421211201 2 days ago
bp-58e26c71-df93-4afa-88d5-14e261211201 2 days ago
bp-6fb1ca8c-81d3-4eed-81ec-5b7441211201 2 days ago
bp-384016e0-ce16-4b75-a5fb-84ff81211130 3 days ago
bp-eb66e1f9-ffbf-4da8-bcae-74dee1211130 3 days ago
bp-43824e58-95ee-46bf-ae92-5694c1211130 3 days ago
bp-fe7718ee-f5e0-4326-9791-2cc7b1211130 3 days ago
bp-03cac325-8577-41d3-97ed-4ffe81211130 3 days ago
bp-46028c58-f7a0-42cc-8120-535691211130 3 days ago
bp-3e9d3ae2-3220-4a39-be9b-a23591211130 3 days ago
bp-4721a06e-b850-4858-b1c5-ac2c31211130 3 days ago
bp-a085edf7-c844-4709-923c-5f6b51211130 3 days ago
bp-55167ff3-b01b-463f-9f3b-826561211130 3 days ago
Comment 7•2 years ago
|
||
Does this still reproduce for you?
Reporter | ||
Comment 8•2 years ago
•
|
||
(In reply to Wayne Mery (:wsmwk) from comment #7)
Does this still reproduce for you?
I do still see this on 110.0b4 taking around 30-60 seconds to fully shut down. When I briefly used 111.0b1, shutdown took maybe 1/2 a second or less.
For the brief moment that I was able to capture a 110.0b4 perf profile during shutdown, this is what I got: https://share.firefox.dev/3Jhx5Vc
Comment 9•2 years ago
|
||
We have a winner - it's waiting on cleaning up trash folder https://searchfox.org/comm-central/rev/9fecf68e84150f35329821f5bfbf0af525d07999/mailnews/base/src/nsMsgAccountManager.cpp#1558
Reporter | ||
Comment 10•2 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #9)
We have a winner - it's waiting on cleaning up trash folder https://searchfox.org/comm-central/rev/9fecf68e84150f35329821f5bfbf0af525d07999/mailnews/base/src/nsMsgAccountManager.cpp#1558
Did you glean this from the perf profile?
Comment 11•2 years ago
|
||
(In reply to Arthur K. (he/him) from comment #10)
(In reply to Wayne Mery (:wsmwk) from comment #9)
We have a winner - it's waiting on cleaning up trash folder https://searchfox.org/comm-central/rev/9fecf68e84150f35329821f5bfbf0af525d07999/mailnews/base/src/nsMsgAccountManager.cpp#1558
Did you glean this from the perf profile?
Essentially. hit *
to expand all the frames, and go to nsMsgAccountManager::CleanupOnExit
where it changes from 62% to 57%. The frames starting at 57% are waits.
Comments from a developer "It looks like we have some PR_Wait calls inside of that function [nsMsgAccountManager::CleanupOnExit
] that actually does nothing but to wait for 1000 microsecond in a while loop here. you can also see the same thing in the profiler source code view when you double click on the nsMsgAccountManager::CleanupOnExit frame on the call tree. looks like most of the time is spent in this line. apparently it's trying to empty the trash but it's taking longer than expected?"
Reporter | ||
Comment 12•2 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #11)
(In reply to Arthur K. (he/him) from comment #10)
(In reply to Wayne Mery (:wsmwk) from comment #9)
We have a winner - it's waiting on cleaning up trash folder https://searchfox.org/comm-central/rev/9fecf68e84150f35329821f5bfbf0af525d07999/mailnews/base/src/nsMsgAccountManager.cpp#1558
Did you glean this from the perf profile?
Essentially. hit
*
to expand all the frames, and go tonsMsgAccountManager::CleanupOnExit
where it changes from 62% to 57%. The frames starting at 57% are waits.
Cool. Glad it was able to shine a light on the source/cause.
Comments from a developer "It looks like we have some PR_Wait calls inside of that function [
nsMsgAccountManager::CleanupOnExit
] that actually does nothing but to wait for 1000 microsecond in a while loop here. you can also see the same thing in the profiler source code view when you double click on the nsMsgAccountManager::CleanupOnExit frame on the call tree. looks like most of the time is spent in this line. apparently it's trying to empty the trash but it's taking longer than expected?"
So, seeing as my brief experience with 111.0b1 was positive with respect to this shutdown issue, did nsMsgAccountManager.cpp#1558 get examined and fixed there already or just coincidence?
Comment 13•2 years ago
|
||
(In reply to Arthur K. (he/him) from comment #12)
So, seeing as my brief experience with 111.0b1 was positive with respect to this shutdown issue, did nsMsgAccountManager.cpp#1558 get examined and fixed there already or just coincidence?
I'd be surprised if it had gotten fixed. I would not be surprised if your problem returns.
Reporter | ||
Comment 14•2 years ago
|
||
Took me about 25 tries but I was able to capture a perf profile with 111.0b3: https://share.firefox.dev/3yiqCD1
Same story?
Comment 15•2 years ago
|
||
(In reply to Arthur K. (he/him) from comment #14)
Took me about 25 tries but I was able to capture a perf profile with 111.0b3: https://share.firefox.dev/3yiqCD1
Same story?
Yes. If you select the range in black in "parent process" at the top with your mouse, and then expand the call tree, all of the wait time is under nsMsgAccountManager::CleanupOnExit
Updated•2 years ago
|
Comment 16•2 years ago
|
||
Please try 115.1.0 or beta 117 (available shortly)
Reporter | ||
Comment 17•2 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #16)
Please try 115.1.0 or beta 117 (available shortly)
I tested at home with the 2nd build of 115.1.0 just this morning and it still took a while to shut down. I'm waiting on the portable 115.1.0 to get published so I can update here on my work PC.
Reporter | ||
Comment 18•2 years ago
|
||
(In reply to Wayne Mery (:wsmwk) from comment #16)
Please try 115.1.0 or beta 117 (available shortly)
So here's something really weird. I tested again with 115.1.0 (build 20230731171153) just now and am getting a shutdown time of +/- 1m 20sec. I repeated this test over a few times and got about the same result. Naturally, I decided to capture a per profile to see what the holdup is. As strange as it sounds, I am unable to finish a capture and upload the results because within a few seconds of ending the capture and being moments away from clicking the "Upload" button, TB shuts down gracefully. This happens with only capturing about 10 seconds of profiling info.
Ok, strike that. Somehow I was quick and lucky enough to capture two perf profiles:
https://share.firefox.dev/43QkwqO
https://share.firefox.dev/3KjnPA0
Comment 19•4 months ago
|
||
I definitely appreciate it is challenging to capture. There's not much going on in the majority of the profile. I think more detail is required.
Does it still reproduce with version 128 or newer? Is antivirus software running?
https://profiler.firefox.com/docs/?#/./guide-startup-shutdown?id=shutdown has instructions on capturing shutdown. You'll also want to enable "All File IO" and socket thread. reference https://support.mozilla.org/en-US/kb/profiling-thunderbird-performance
Reporter | ||
Comment 20•4 months ago
|
||
I'd have to test on my home PC tonight as that's where I have this old email account. Let me come back to this one later on.
Reporter | ||
Comment 21•4 months ago
|
||
Tested just now with my old work account and set it to Empty trash on Exit and it did not hang or crash. Tested with 128.3.2. Quickly and gracefully exited using File > Exit. I think we can finally close this bug and bug 1869297.
Comment 22•4 months ago
|
||
Thanks forthe update
Description
•