Boinc client will not close during computer shutdown

Started by Tom_unoduetre, July 25, 2011, 08:52:00 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tom_unoduetre

Hey,

I noticed this behaviour now a couple of times: When I shut down my PC the current project gets stuck will not close, and I have to manually click on the "finish now" button in the error message. I am not sure why this happens only sometimes, on other days I can shutdown the PC normally. What information do you need from me to check this issue? Maybe my wish list request to have an option that Boinctasks can close the Boinc client could solve this?

Thanks

fred

Quote from: Tom_unoduetre on July 25, 2011, 08:52:00 AM
I noticed this behaviour now a couple of times: When I shut down my PC the current project gets stuck will not close, and I have to manually click on the "finish now" button in the error message. I am not sure why this happens only sometimes, on other days I can shutdown the PC normally. What information do you need from me to check this issue? Maybe my wish list request to have an option that Boinctasks can close the Boinc client could solve this?
Looks like a project application problem, check with the project.
The client is closed by Windows, not something BoincTasks does.

Tom_unoduetre

Not sure if that´s a project issue as this occurs since I´m using Boinctasks. With the BoincManager all was well.

fred

Quote from: Tom_unoduetre on July 26, 2011, 08:28:26 AM
Not sure if that´s a project issue as this occurs since I´m using Boinctasks. With the BoincManager all was well.
There is as timer delay on the shutdown. It may take a minute or so.
So wait and do nothing, just wait for windows to close down.

Tom_unoduetre

Yes, but the question itself stays the same: why is this happening with Boinctasks and not with the Boinc Manager? Does maybe the Boinc Manager sends some kind of command to the client which is not happening with BT?

It is not really a major issue for me as I now just watch the shutdown more properly, but I find this very interesting.

Do other users don´t have this issue?

By the way, thank you very much for your time you spend in developing BT, it´s such a great tool!

Corsair

I use to have similar issue, but I think it's on BOINC Manager side, quite often I quit from BOINC Manager
and BOINC still being working in the background (no matter what project is running), when in the first runs
I set to kill BOINC when quitting from Manager.
Roses don't bloom on the sailor's grave

Corsair.

fred

Quote from: Tom_unoduetre on July 26, 2011, 01:10:52 PM
Yes, but the question itself stays the same: why is this happening with Boinctasks and not with the Boinc Manager? Does maybe the Boinc Manager sends some kind of command to the client which is not happening with BT?
I added the option to close the BOINC client on exiting BoincTasks in V 1.14. This may do something
But shutting down in Windows isn't too predictable. BoincTasks may get the time to shut down the client.
It depends on the Windows version, client version and project.

Tom_unoduetre

Thanks fred for taking care of this. I will monitor which projects are running right before I shutdown, maybe this can give us somehints for future observations. But maybe this is solved with 1.14

Beyond

It has been a longstanding issue that shutting down BOINC manager (with the option clicked to shut down the projects) does not always actually close boinc.exe and/or some of the projects.  Sometimes when restarted the manager can't connect to the projects unless the previous boinc.exe and boinctray.exe are killed in task manager.  Reported many times.  Just recently it seems to be working a bit better with the last few builds (6.12.33) so maybe the problem is finally being addressed.

Tom_unoduetre

Just to let you know that I still have this behaviour with the latest Boinc client 6.12.33 and Boinctasks 1.14. I have ticked the option that BS should end the client on exit (I don´t exit BS before I shutdown but let it close by Windows). I will monitor this again for the next days, maybe I can find a pattern.

LumenDan

I have also noticed that BoincTasks is often listed as a program that is preventing shutdown.
There could be a simple solution to this behavior:

If the BoincTasks application doesn't return true when it receives the WM_QUERYENDSESSION message then Windows will assume the program is performing an important function that should not be interrupted and postpone the system shutdown process. If the program doesn't return true in response to a WM_QUERYENDSESSION message within 5 seconds then  Windows will prompt the user to approve the action of forcing the program to close.

See: https://docs.microsoft.com/en-gb/windows/desktop/Shutdown/system-shutdown-messages
In the above linked documentation it is stated:
QuoteApplications should respect the user's intentions and return TRUE. By default, the DefWindowProc function returns TRUE for this message.
I'm not sure which development environment is used to create BoincTasks but in my own Visual Studio programming experience I have found that application templates do not always follow this rule by default and it is sometimes necessary to override the application's default message handler to check for the WM_QUERYENDSESSION message and return true immediately.

fred

Quote from: LumenDan on June 28, 2018, 09:21:44 AM
I have also noticed that BoincTasks is often listed as a program that is preventing shutdown.
I'm using Visul Studio Prof 2013 in CPP.
BoincTasks does all the above.

In ON_WM_QUERYENDSESSION it starts shutting down BoincTasks, the same as in File->exit and this may take a while.
The logging is done here:
C:\Users\username\AppData\Roaming\eFMer\BoincTasks\log
The log of the previous day should show
Exit ---- BoincTasks is shutting down, because Windows sends an end session
Exit ---- BoincTasks has shut down

fred

In V 1.78 BoincTasks no longer blocks shutdown.

LumenDan

QuoteIn V 1.78 BoincTasks no longer blocks shutdown.

Thanks for the update Fred, it's good to hear that.