Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 10 and 11 version "forgets" CPU WU after system restart #290

Open
muziqaz opened this issue Sep 23, 2024 · 19 comments
Open

Windows 10 and 11 version "forgets" CPU WU after system restart #290

muziqaz opened this issue Sep 23, 2024 · 19 comments

Comments

@muziqaz
Copy link
Contributor

muziqaz commented Sep 23, 2024

I thought it would be better to create a separate issue regarding the WU stuff.
So every time I restart my Windows PCs, both systems FAH client downloads new WU instead of continuing with the old one, which was downloaded and being folded before the restart. On one system I can see 5 WU folders in Work directory, while I am only folding one at the moment.
Log is not showing anything suspicious, except some subprocess error 14:20:09:E :Subprocess deallocated while process is still running
Here is the log.
log.txt

There has been no alterations to both systems in regards to boot/restart sequence. Everything is default as father Microsoft intended.

Linux system seems to work as intended

I mentioned this issue before in this comment and thread: #286 (comment)

@kbernhagen
Copy link
Contributor

Does the forgetting not happen if you quit the client via sys tray before restarting the system?

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 23, 2024

Does the forgetting not happen if you quit the client via sys tray before restarting the system?

Quitting and then restarting resumes from where it stopped.

@kbernhagen
Copy link
Contributor

My thought, which has been disputed in the past, is that Windows unceremoniously kills the client when there is a reboot, leaving database locked with unsaved changes.

The client is also running a native Win event loop.
Maybe it just needs to catch appropriate messages for logout/shutdown.

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 23, 2024

I have a suspicion, too, that windows shutdown procedures are killing FAH processes, however, these systems had no issues with v7, as well as v7 would survive crashing system most of the time. I think v8 needs a bit more robust progress saving system. I'm not sure how v8 reacts to crahsing systems, since mine have been stable for quite some time now.

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 23, 2024

Also, what is weird, that V8 is downloading new WU, instead of resetting currently running one to zero.
V7 sometimes used to lose WU's progress if system crash was severe. It had never lost a WU.
Well there were several very rare occasions when another WU would get downloaded while old one was still there, but it would be visible in fahcontrol, and once newly downloaded WU was completed fahclient would pick up the old one and continue from where it left off.
It would be great that I could still complete those other 4 WUs sitting on my SSD with v8

@jcoffland
Copy link
Member

Could this be the same permissions issue that is causing the client not to restart. If the old WUs file permissions were changed such that it was inaccessible then it would not run after reboot. In this case, I would expect the old WU files to still be on the disk.

@jcoffland
Copy link
Member

The permissions problem could be caused by either the client trying to start in the wrong directory, the file permissions on log.txt or it's directory are actually being changed or the client is starting under the wrong user.

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

I will be able to test this in an hour or so. The test PC has ProgramData/FahClient security settings tweaked to allow writing by any Users, which solved the restart issue. Do you have some sort of longer WU for me to download during the test that I do not lose real work? 2 minute long WU would be sufficient. If you don't mind creating something, ping me details in the Slack
Thanks

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

Just restarted the PC and it downloaded new WU ignoring the old one. Here is the log. Old one had 2% done.
log.txt

Windows Event Viewer does not report any FAH related errors or any other app related errors.
ProgramData/FAHClient folder retained write permissions I set up previously

@jcoffland
Copy link
Member

It does look like the client was hard killed during shutdown. The log just ends abruptly. Then when it starts again it says: Loaded 0 wus.

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

Not sure if that makes any difference, on my Windows 10 PC, FAHClient process is running under muziqaz2 user name.
ProgramData\FAHClient security properties list:
CREATOR OWNER (which has no permissions and I am not allowed to change it, it reverts to nothing, when I apply the changes)
SYSTEM (which has full control)
Administrators (MUZIQAZ2\Administrators) (has full control)
Users (MUZIQAZ2\Users) (which has Read & Execute, List contents, Read, Write)

ProgramData\FAHClient\work security properties have the same as above

ProgramData\FAHClient\work\wudirectory (which got forgotten) security properties have as above, PLUS:
muziqaz2 (MUZIQAZ2\muziqaz2) (which has nothing but Special Permissions ticked)

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

Just for giggles, I gave full control to muziqaz2 for the WU folder, rebooted, it still downloaded new WU. So doubt this is permission issue

@jcoffland
Copy link
Member

Does this build work any better?: https://master.foldingathome.org/builds/fah-client/windows-10-64bit/release/v8.4.6-b135/fah-client_8.4.6_AMD64.exe

I added detection of the Windows shutdown message.

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

It does look like the client was hard killed during shutdown. The log just ends abruptly. Then when it starts again it says: Loaded 0 wus.

I don't believe I am breeding killer OSs :D
If it makes any difference they are Win 11 Pro and Win 10 Pro. Both have 22H2 updates, which seem to be the latest for those OS builds. I believe 22H2 is just a name, and it contains all the latest stuff from 24H2

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

New version ignored old WU and downloaded new WU after installation even without the system restart :( Is it possible windows process termination method is broken on my systems, which can't be, since it would be hell of the coincidence to have 2 different Windows versions sledgehammering processes instead of closing them
Restarting the system now

@muziqaz
Copy link
Contributor Author

muziqaz commented Sep 25, 2024

Restarting still downloaded new WU
log.txt

Also, installation did not change ProgramData\FAHClient permissions

@kbernhagen
Copy link
Contributor

Is the Windows logout message also handled by the new code?

@jcoffland
Copy link
Member

I added code to shut the client down if it receives a WM_QUERYENDSESSION or WM_ENDSESSION message.

@bollix47
Copy link

bollix47 commented Oct 16, 2024

Today I had reason to pause folding on W11 and lost all progress using 8.4.5
https://foldingathome.slack.com/archives/C01257G67MW/p1729111718571409
If that link doesn't work it's posted in the fahclient channel of slack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants