159 Commits

Author SHA1 Message Date
dan engelbrecht
cb4a52a496 Allow zenserver to be installed using a "link" to the installed UE executables instead of copying to the %PROGRAMDATA% folder which may have restrictions preventing the zenserver executable from running.
Selecting "link" or "copy" is done automatically by checking if UE is running from an installed place or if it is a dev/p4 stream place, you can override this with the option -ZenAutoLaunchInstallMode.
The ZenAutoLaunchInstallMode defaults to "auto" where it tries to detect if it is an installed engine or not. "link" forces the use of a link file and "copy" forces the copy-install option which is the legacy behavior.

Additional fixes:
FMacSystemWideCriticalSection which could fail to aquire the critical section causing launch to fail  now uses flock in the same manner as FUnixSystemWideCriticalSection which resolves the issues
When checking if processes are running on Unix/Mac we now detect zombie processes properly

#jira UE-224517

#rb zack.neyland, Zousar.Shaker

[CL 36764363 by dan engelbrecht in 5.5 branch]
2024-10-01 20:41:28 -04:00
dan engelbrecht
b9f05c16a4 Add missing check if zenserver process is running when we time out waiting for it
Fixes problem with CL 36532666

#jira UE-224531

[CL 36757563 by dan engelbrecht in 5.5 branch]
2024-10-01 19:31:04 -04:00
dan engelbrecht
c928ce611b Use named event to wait for zenserver readyness instead of agressively polling the zenserver lock file
Remove the restoring of sponsored processes when trying to recover - we should never touch them unless we are adding a process ourselves.
Refactored out ZenServerState and ZenNamedEvent into separate file so we don't have low-level zenserver specific code in ZenServerInterface.cpp.

#jira UE-224531
#rb Zousar.Shaker

[CL 36757557 by dan engelbrecht in 5.5 branch]
2024-10-01 19:30:59 -04:00
Zousar Shaker
aceca28ef8 Rename Zen.AutoLaunch parameter AllowPublicNetworkInterface to AllowRemoteNetworkService ahead of 5.5 release so that terminology is clearer to understand and document (avoids confusion around public/private network terms as used in Windows).
#jira none
#rb matt.peters

[CL 36211791 by Zousar Shaker in 5.5 branch]
2024-09-11 17:53:58 -04:00
zousar shaker
00da45dc85 Separate the control mechanism for launching zenserver with public network interfaces into its own config parameter instead of keeping it in the catch-all ExtraArgs config parameter using the --http-forceloopback argument.
#rb Matt.Peters

[CL 35201893 by zousar shaker in ue5-main branch]
2024-07-30 18:40:16 -04:00
dan engelbrecht
09c34df272 Verify that a different process has not recovered the zenserver process before forcing a restart
#jira UE-216389
#rb zousar.shaker

[CL 34333467 by dan engelbrecht in ue5-main branch]
2024-06-13 04:03:10 -04:00
dan engelbrecht
8b1ebc81f9 Add recovery of zenserver from project store operations in addition to the DDC recovery logic
#jira UE-211547
#rb zousar.shaker

[CL 34277558 by dan engelbrecht in ue5-main branch]
2024-06-11 11:06:44 -04:00
dan engelbrecht
00bd4582eb Add a timeout when locking for zenserver recovery and validate that we get the lock before attempting recovery.
This avoid a race condition where multiple threads would try to start recovery at the same time.
#jira UE-216389
#rb zousar.shaker

[CL 34277375 by dan engelbrecht in ue5-main branch]
2024-06-11 11:05:27 -04:00
steve robb
bc28537104 Fixed some Printf specifiers.
#rb brandon.schaefer

[CL 33211124 by steve robb in ue5-main branch]
2024-04-24 15:59:50 -04:00
zousar shaker
6c36f81729 Make sure we install the PDB for the zen.exe utility when performing an installation and not just the PDB for the zenserver.exe service.
#rb dan.engelbrecht

[CL 32942476 by zousar shaker in ue5-main branch]
2024-04-12 16:11:55 -04:00
dan engelbrecht
96aeb2545b Don't try to read the payload buffer as a package in FZenCacheStore::FCbPackageReceiver if the request failed or was cancelled
Add hardening to TryLoadCbPackage to handle incomplete messages

[CL 32929188 by dan engelbrecht in ue5-main branch]
2024-04-12 10:31:10 -04:00
zousar shaker
e76b8acd1d Ensure that if we fail to launch zenserver with the CREATE_BREAKAWAY_FROM_JOB flag on Windows that we try again without that flag.
#rb Matt.Peters
#jira UE-211574

[CL 32772317 by zousar shaker in ue5-main branch]
2024-04-05 16:54:36 -04:00
zousar shaker
c50234b1ed Ensure that if we fail to launch zenserver with the CREATE_BREAKAWAY_FROM_JOB flag on Windows that we try again without that flag.
#rb Matt.Peters

[CL 32710198 by zousar shaker in ue5-main branch]
2024-04-03 16:47:09 -04:00
zousar shaker
e6554be1b8 Ensure that zenserver http requests from the zen server interface (not the DDC layer) bypass proxies when communicating with zenserver.
[FYI] dan.engelbrecht, Devin.Doucette
#jira UE-210567

[CL 32527896 by zousar shaker in ue5-main branch]
2024-03-26 18:45:00 -04:00
dan engelbrecht
652149367f Add support of partial zen DDC GetChunks requests
#ushell-cherrypick of 32395474 by dan.engelbrecht
#rb Devin.Doucette
#jira UE-210439
[FYI] tim.doerries, Zousar.Shaker, Stefan.Boberg

[CL 32452554 by dan engelbrecht in ue5-main branch]
2024-03-22 17:53:31 -04:00
zousar shaker
1ccf5decf0 Ensure that if zenserver AutoLaunch fails that we have at least one more attempt launch, even if the first attempt exceeded our wait timeout. This can occur if the first attempt spent a while waiting for the lock to free up.
[FYI] dan.engelbrecht
#jira UE-207039

[CL 32419208 by zousar shaker in ue5-main branch]
2024-03-21 17:55:38 -04:00
zousar shaker
fc02a17725 Further hardening of zen launch sequence.
#rb dan.engelbrecht
#jira UE-207039

[CL 32339910 by zousar shaker in ue5-main branch]
2024-03-19 17:27:44 -04:00
zousar shaker
d524494c62 Address missing file descriptor close on Mac/Linux that is related to the lock file handling when launching zenserver. Also fix an incorrect return value from the Mac/Linux implementation of IsLockFileLocked in the case of an orphaned lock file.
#rb stefan.boberg
#jira UE-207039

[CL 32233751 by zousar shaker in ue5-main branch]
2024-03-13 19:29:39 -04:00
zousar shaker
cdc085bac6 Remove one line edit added in my previous changelist because it isn't necessary.
#rb dan.engelbrecht
#jira UE-207039

[CL 32184411 by zousar shaker in ue5-main branch]
2024-03-12 13:15:49 -04:00
zousar shaker
afb8855979 Address zenserver autolaunch/lifecycle issues identified on Windows, Mac, and Linux using lifecycle stress test.
#rb dan.engelbrecht
#jira UE-207039

[CL 32174180 by zousar shaker in ue5-main branch]
2024-03-12 01:52:39 -04:00
zousar shaker
404a8affe6 Attempt shut down of running zenserver process if we find a locked lock file but the pid registered in the lock file can't be found.
If a pid can not be found when finding a matching desired/effective port, keep looking if any other state has a matching port.
Hardened and added logging to NativeIsProcessRunning.

Run of Low Level Tests in Main  here: https://horde.devtools.epicgames.com/job/65e81c5d156d6df40d304906

#jira UE-207039
#rb Zousar.Shaker

#ushell-cherrypick of 31938454 by swarm

[CL 32068216 by zousar shaker in ue5-main branch]
2024-03-06 16:52:12 -05:00
zousar shaker
0c40eb4aef Identify zenserver as Unreal Zen Storage Server in messagebox dialogs and accompanying logs for high priority messages. Ensure google drive warning follows the same messagebox/log logic as other prompts. Eliminate the use of RequestExit from within ZenServerInterface, failure should not force process shutdown.
#rb dan.engelbrecht
#jira UE-208878

[CL 32022078 by zousar shaker in ue5-main branch]
2024-03-05 11:23:40 -05:00
dan engelbrecht
4f7386867d Use process-unique name for zen data directory validity test
Fixes warning "Warning: [CookWorker 2]: Skipping subprocess environment variable UE-ZenSubprocessDataPath=d:/build/++Fortnite/Sync/ZenData due to an invalid path" caused by a race condition between multiple cook workers.
See https://horde.devtools.epicgames.com/log/65dc47bbdd128eaa49c6cc13?lineindex=90207
#jira UE-208562

#rb Zousar.Shaker

[CL 31941714 by dan engelbrecht in ue5-main branch]
2024-03-01 08:58:49 -05:00
zousar shaker
a926360c9d Change default zen data and install directories to be per-user, and clean up old default directories when migrating to a new one.
#rb dan.engelbrecht
#jira UE-205982

[CL 31567090 by zousar shaker in ue5-main branch]
2024-02-16 11:15:16 -05:00
zousar shaker
217c59362e Fix a bug where ZenServer data path would not update if you initiated an editor restart after changing the Global Local Data Cache Path. This was due to environment variable inheritance of UE-ZenSubprocessDataPath. This change ensures that environment variable is cleared as part of shutdown before the editor spawns a new instance of itself. Also fixed some whitespace issues in passing.
#rb dan.engelbrecht
#jira UE-204051

[CL 31521807 by zousar shaker in ue5-main branch]
2024-02-15 11:26:49 -05:00