Emclient not closed correctly

@Sylwester_Zarebski

When window is closed, executable should exit as well, but it is not the case. I’ve have seen this behaviour few times, even if my computer is mostly high end

After exiting eM Client, if the "Mailclient.exe* process is not closing within aprox 3-5 secs in the task manager using recent V7/8 versions of eM Client (apart from hardware issues with slow mechanical drives or slow ram write speed etc) as already advised above by other users, this can also be caused by “other non OS optional background resident tasks” interfering with with eM Client in memory.

So I would suggest to test “disable all optional background tasks” except for just the basic OS and reboot and see if the MailClient.exe process then closes properly after exiting.

If the MailClient.exe process then closes correctly, then you have to enable your optional background tasks one at a time and reboot in between till you find which program it is causing the issue.

If disabling all background non OS related programs made no difference, then suggest to next try a new “Windows or Mac user OS Profile”. Sometimes user profiles can also have issues.

If the new user OS profile then works ok, then you just backup eM Client via “Menu / Backup” in your old profile and copy the backup.zip file outside your current profile (so you can access it), and then restore the backup in your new user profile.

On my two stock Win 10 PC’s V21H1 (with the recent eM Client builds) V8.2.1659 for Windows, the EMC “MailClient.exe” process closes now in aprox 3secs (everytime) after exiting eM Client without fail. I use an SSD drive, 16gb ram & an i7 cpu.

sábado 09 octubre 2021 :: 0918hrs (UTC +01:00)

Hi @Sylwester_Zarebski

You say: When window is closed, executable should exit as well, but it is not the case. I’ve have seen this behaviour few times, even if my computer is mostly high end.

Perhaps it is the part of your computer that is NOT ‘mostly high end’ that is the issue.

I agree with @cyberzork and perhaps there is an issue with your profile or your computer is not as high end as you think.

¡Saludos desde la soleada Valencia en España!
¡Mis mejores deseos y mantente a salvo!

Skybat
[email protected]

Hablo español, luego portugués e inglés, con conocimiento de varios otros idiomas.

That is why I said to check the task manager. If you close eM Client, but it is not closing, that is another issue.

So close eM Client, and check task manager. Is eM Client still running? Give it a second or two. Is eM Client still running? How long does it take to close and disappear from task manager? Or does it never disappear? Check both apps and background processes.

Make sure you have not set eM Client to Close to Tray, as that does not close the application at all.

Also, check if you have set eM Client to empty Trash on exit. This will delay closing the application while it sends a command to the IMAP server.

Where is the database stored? If it is on a mechanical disk, the close will be slow. Try with the database on an SSD and see if there is any difference.

How about disabling the anti-virus application? Disable that, then with eM Client running, shut down Windows as normal. Does that make any difference?

I will try also (out of curiosity regarding the result) the suggestion to first close eM Client and immediately after that run “shut down windows” command.

But in parallel … related to the idea that it is not eM Client’s fault because Windows it’s closing it … I have a misunderstanding: Many times I’ve seen applications doing like in the screenshot (windows will not shutdown until that application gets closed or I press Shut down anyway). For me it’s clear that Windows did NOT forcedly closed Fusion 360. Why can not eM Client do the same like in this screenshot ?

@adynis

When you get that Windows blue screen “Closing x apps and shutting down”, that just normally means you have either “shutdown too quick” and haven’t given these programs enough time to close first, or those programs “are still open” and have to be closed first to avoid possibly corrupting them.

So for these blue screens, you would normally “click cancel” and make sure no programs are still open and close them if they are. Then shutdown again.

Note:- If you still get the same warnings on shutdown a second time and you definitely know they are closed, then shutdown anyway.

I agree. In the example above I was in the second variant you mentioned (a program still opened because I didn’t save the workspace)
Related to the screenshot, personally I see:

  • A nice Windows feature
  • The proof that there is a way for an app to communicate with windows in order not to be killed on shutdown
  • A solution example I would appreciate to have also with eM Client

After exiting eM Client, if the "Mailclient.exe* process is not closing within aprox 3-5 secs in the task manager using recent V7/8 versions of eM Client

And this is the case. Behaviour is wrong. Software must NOT work in background when closing its windows (on exit, not close when going to tray). Postponing actions to background when exiting IS BAD PRACTICE. It is irrelevant if it is 1, 2 or 30 seconds. Closing window MUST BE LAST ACTION on proper user experience.

martes 12 octubre 2021 :: 0832hrs (UTC +01:00)

Hi @Sylwester_Zarebski

And your point?
You have said all this before!

¡Saludos desde la soleada Sevilla en España!
¡Mis mejores deseos y mantente a salvo!

Skybat
[email protected]

Hablo español, luego portugués e inglés, con conocimiento de varios otros idiomas.

1 Like

@Sylwester_Zarebski

eM Client does “not stay working” in the background “when the program is completely closed” unless you have it set to “Close to Tray” or “Minimize to Tray”.

As “with all programs” when you open / launch them, they will all show as a “Process” in the task manager and then when you close them after exiting the program, they will shortly after disappear from the task manager. That normally takes a few seconds as “is just the way Windows closed processes”. If you don’t like that, then you should contact Microsoft directly and complain about their OS.

As i explained if your computer is not closing the “MailClient.exe” process after exiting eM Client then that’s your computer issue where you need to do troubleshooting. Nothing wrong with eM Client.

Wrong. It is. How to find it:

  1. Open program, when not connected to remote server, close program. It closes main window, and then exists within 2-3 seconds.
  2. Open program, click refresh button (connect to server), and close program. It closes main window, and then exits after 5 or more seconds.

Program must close background tasks before closing main window because of bad user experience, as OP.

.

… normally takes a few seconds as “is just the way Windows closed processes"…

It looks like You have little knowledge, because running and exiting process takes less than 1 ms on Windows. You may be confused by running frameworks like .NET which do some maintenance.

@Sylwester_Zarebski

That’s just how “all processes” close after exiting all sorts of different programs (on every version of Windows) I’ve ever had from Windows 3.1 & up.

You just seem to be not happy “with the way Windows closes processes” after exiting. Again you can take it up with Microsoft and good luck.

I’ve just made simple C# WinForms program (set as console, to not detach from parent), which closes after initializing it’s window (Close() inside OnShown() event). It takes about 0.25 s to initialize .NET stack, open full WinForms window, close window, deinitialize full stack, then exit process.

Man, You are so wrong, that i’m speechless.

PS. Some stats:

...\WindowsFormsApp1\bin\Debug>cmd /v:on /c "echo !time! & .\WindowsFormsApp1.exe & echo !time!"
10:25:14,52
10:25:14,74

...\WindowsFormsApp1\bin\Debug>cmd /v:on /c "echo !time! & .\WindowsFormsApp1.exe & echo !time!"
10:25:15,40
10:25:15,61

...\WindowsFormsApp1\bin\Debug>cmd /v:on /c "echo !time! & .\WindowsFormsApp1.exe & echo !time!"
10:25:16,25
10:25:16,47

...\WindowsFormsApp1\bin\Debug>cmd /v:on /c "echo !time! & .\WindowsFormsApp1.exe & echo !time!"
10:25:17,13
10:25:17,34

martes 12 octubre 2021 :: 1124hrs (UTC +01:00)

Hi @Sylwester_Zarebski

A not very helpful comment you made: Man, You are so wrong, that I’m speechless. (I corrected your typo for you)

There are probably quite a few who wish you were - CLM

I do not know why you continue with this post on the Forum, if it is such a big issue for you, and it appears that it is.
Raise a Ticket with the Developers as they are the only ones who might listen.
In any event a lot of what you say is probably beyond the understanding of computer operating systems of many if not most users of eMC.

¡Saludos desde la soleada Sevilla en España! (it’s 32°C here today)
¡Mis mejores deseos y mantente a salvo!

Skybat
[email protected]

Hablo español, luego portugués e inglés, con conocimiento de varios otros idiomas.

1 Like

If developers want to fix it, then i welcome them to read forum. Which they should nevertheless…

If you ever encounter such problem, enable IMAP logging in menu Settings - Advanced and wait until the problem occurs again. Then send us the logs for further analysis with link to this topic please.