aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-01-17 09:37:15 +0100
committerDan Engelbrecht <[email protected]>2025-01-17 09:37:15 +0100
commit60b8fd33b6708c0640a5df9e8bfc0d9ac1a2a1d7 (patch)
tree86f1ba78b539d5906471c1eb014c260099354e57 /src
parentclang format (diff)
parentadd missing statsd.enabled and gc.projectstore.duration.seconds (#275) (diff)
downloadzen-60b8fd33b6708c0640a5df9e8bfc0d9ac1a2a1d7.tar.xz
zen-60b8fd33b6708c0640a5df9e8bfc0d9ac1a2a1d7.zip
Merge remote-tracking branch 'origin/main' into de/zen-service-command
Diffstat (limited to 'src')
-rw-r--r--src/zen/cmds/admin_cmd.cpp3
-rw-r--r--src/zen/cmds/cache_cmd.cpp2
-rw-r--r--src/zen/cmds/print_cmd.cpp2
-rw-r--r--src/zen/cmds/projectstore_cmd.cpp9
-rw-r--r--src/zen/cmds/rpcreplay_cmd.cpp2
-rw-r--r--src/zencore/basicfile.cpp (renamed from src/zenutil/basicfile.cpp)2
-rw-r--r--src/zencore/include/zencore/basicfile.h (renamed from src/zenutil/include/zenutil/basicfile.h)0
-rw-r--r--src/zencore/zencore.cpp2
-rw-r--r--src/zenhttp/auth/authmgr.cpp2
-rw-r--r--src/zenhttp/httpclient.cpp4
-rw-r--r--src/zenhttp/httpserver.cpp2
-rw-r--r--src/zenhttp/include/zenhttp/packageformat.h (renamed from src/zenutil/include/zenutil/packageformat.h)0
-rw-r--r--src/zenhttp/packageformat.cpp (renamed from src/zenutil/packageformat.cpp)2
-rw-r--r--src/zenhttp/servers/httpasio.cpp4
-rw-r--r--src/zenhttp/servers/httpparser.cpp2
-rw-r--r--src/zenhttp/servers/httpplugin.cpp4
-rw-r--r--src/zenhttp/servers/httpsys.cpp4
-rw-r--r--src/zenhttp/xmake.lua2
-rw-r--r--src/zenhttp/zenhttp.cpp3
-rw-r--r--src/zenserver-test/zenserver-test.cpp2
-rw-r--r--src/zenserver/cache/httpstructuredcache.cpp4
-rw-r--r--src/zenserver/config.cpp25
-rw-r--r--src/zenserver/objectstore/objectstore.cpp2
-rw-r--r--src/zenserver/projectstore/buildsremoteprojectstore.cpp2
-rw-r--r--src/zenserver/projectstore/jupiterremoteprojectstore.cpp2
-rw-r--r--src/zenserver/projectstore/projectstore.cpp2
-rw-r--r--src/zenserver/projectstore/remoteprojectstore.cpp7
-rw-r--r--src/zenserver/projectstore/zenremoteprojectstore.cpp2
-rw-r--r--src/zenserver/upstream/upstream.h1
-rw-r--r--src/zenserver/upstream/upstreamcache.cpp8
-rw-r--r--src/zenserver/upstream/zen.cpp2
-rw-r--r--src/zenserver/workspaces/httpworkspaces.cpp2
-rw-r--r--src/zenserver/zenserver.cpp3
-rw-r--r--src/zenstore/cache/cacherpc.cpp2
-rw-r--r--src/zenstore/chunkedfile.cpp2
-rw-r--r--src/zenstore/filecas.cpp2
-rw-r--r--src/zenstore/gc.cpp22
-rw-r--r--src/zenstore/include/zenstore/blockstore.h2
-rw-r--r--src/zenstore/include/zenstore/caslog.h2
-rw-r--r--src/zenstore/workspaces.cpp2
-rw-r--r--src/zenutil/cache/rpcrecording.cpp5
-rw-r--r--src/zenutil/include/zenutil/jupiter.h (renamed from src/zenserver/upstream/jupiter.h)0
-rw-r--r--src/zenutil/include/zenutil/logging/rotatingfilesink.h2
-rw-r--r--src/zenutil/jupiter.cpp (renamed from src/zenserver/upstream/jupiter.cpp)14
-rw-r--r--src/zenutil/xmake.lua2
-rw-r--r--src/zenutil/zenserverprocess.cpp2
-rw-r--r--src/zenutil/zenutil.cpp4
47 files changed, 100 insertions, 78 deletions
diff --git a/src/zen/cmds/admin_cmd.cpp b/src/zen/cmds/admin_cmd.cpp
index e07e28f54..31e6886b2 100644
--- a/src/zen/cmds/admin_cmd.cpp
+++ b/src/zen/cmds/admin_cmd.cpp
@@ -1,12 +1,13 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "admin_cmd.h"
+
+#include <zencore/basicfile.h>
#include <zencore/filesystem.h>
#include <zencore/logging.h>
#include <zenhttp/formatters.h>
#include <zenhttp/httpclient.h>
#include <zenhttp/httpcommon.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
diff --git a/src/zen/cmds/cache_cmd.cpp b/src/zen/cmds/cache_cmd.cpp
index 00099cebc..6ec6a80db 100644
--- a/src/zen/cmds/cache_cmd.cpp
+++ b/src/zen/cmds/cache_cmd.cpp
@@ -12,8 +12,8 @@
#include <zencore/workthreadpool.h>
#include <zenhttp/httpclient.h>
#include <zenhttp/httpcommon.h>
+#include <zenhttp/packageformat.h>
#include <zenutil/cache/cacherequests.h>
-#include <zenutil/packageformat.h>
#include <memory>
#include <random>
diff --git a/src/zen/cmds/print_cmd.cpp b/src/zen/cmds/print_cmd.cpp
index fa42a3563..469dddf55 100644
--- a/src/zen/cmds/print_cmd.cpp
+++ b/src/zen/cmds/print_cmd.cpp
@@ -8,7 +8,7 @@
#include <zencore/fmtutils.h>
#include <zencore/logging.h>
#include <zencore/string.h>
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
using namespace std::literals;
diff --git a/src/zen/cmds/projectstore_cmd.cpp b/src/zen/cmds/projectstore_cmd.cpp
index 5e18a3624..6bc499f03 100644
--- a/src/zen/cmds/projectstore_cmd.cpp
+++ b/src/zen/cmds/projectstore_cmd.cpp
@@ -2,6 +2,7 @@
#include "projectstore_cmd.h"
+#include <zencore/basicfile.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compress.h>
#include <zencore/filesystem.h>
@@ -14,7 +15,6 @@
#include <zenhttp/formatters.h>
#include <zenhttp/httpclient.h>
#include <zenhttp/httpcommon.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
@@ -1047,15 +1047,16 @@ ExportOplogCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg
TargetUrlBase = fmt::format("http://{}", TargetUrlBase);
}
+ HttpClient TargetHttp(TargetUrlBase);
std::string Url = fmt::format("/prj/{}/oplog/{}", m_ZenProjectName, m_ZenOplogName);
bool CreateOplog = false;
- if (HttpClient::Response Result = Http.Get(Url, HttpClient::Accept(ZenContentType::kJSON)))
+ if (HttpClient::Response Result = TargetHttp.Get(Url, HttpClient::Accept(ZenContentType::kJSON)))
{
if (m_ZenClean)
{
ZEN_WARN("Deleting zen remote oplog '{}/{}'", m_ZenProjectName, m_ZenOplogName)
- Result = Http.Delete(Url, HttpClient::Accept(ZenContentType::kJSON));
+ Result = TargetHttp.Delete(Url, HttpClient::Accept(ZenContentType::kJSON));
if (!Result)
{
Result.ThrowError("failed deleting existing zen remote oplog"sv);
@@ -1077,7 +1078,7 @@ ExportOplogCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** arg
if (CreateOplog)
{
ZEN_WARN("Creating zen remote oplog '{}/{}'", m_ZenProjectName, m_ZenOplogName);
- if (HttpClient::Response Result = Http.Post(Url); !Result)
+ if (HttpClient::Response Result = TargetHttp.Post(Url); !Result)
{
Result.ThrowError("failed creating zen remote oplog"sv);
return 1;
diff --git a/src/zen/cmds/rpcreplay_cmd.cpp b/src/zen/cmds/rpcreplay_cmd.cpp
index d66adfb81..5b88a1f73 100644
--- a/src/zen/cmds/rpcreplay_cmd.cpp
+++ b/src/zen/cmds/rpcreplay_cmd.cpp
@@ -13,8 +13,8 @@
#include <zencore/timer.h>
#include <zencore/workthreadpool.h>
#include <zenhttp/httpcommon.h>
+#include <zenhttp/packageformat.h>
#include <zenutil/cache/rpcrecording.h>
-#include <zenutil/packageformat.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
diff --git a/src/zenutil/basicfile.cpp b/src/zencore/basicfile.cpp
index 391c150c6..c2a21ae90 100644
--- a/src/zenutil/basicfile.cpp
+++ b/src/zencore/basicfile.cpp
@@ -1,6 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved.
-#include "zenutil/basicfile.h"
+#include <zencore/basicfile.h>
#include <zencore/compactbinary.h>
#include <zencore/except.h>
diff --git a/src/zenutil/include/zenutil/basicfile.h b/src/zencore/include/zencore/basicfile.h
index 03c5605df..03c5605df 100644
--- a/src/zenutil/include/zenutil/basicfile.h
+++ b/src/zencore/include/zencore/basicfile.h
diff --git a/src/zencore/zencore.cpp b/src/zencore/zencore.cpp
index db821bff8..82d28c0e3 100644
--- a/src/zencore/zencore.cpp
+++ b/src/zencore/zencore.cpp
@@ -7,6 +7,7 @@
#endif
#include <zencore/assertfmt.h>
+#include <zencore/basicfile.h>
#include <zencore/blake3.h>
#include <zencore/callstack.h>
#include <zencore/compactbinary.h>
@@ -241,6 +242,7 @@ ApplicationExitCode()
void
zencore_forcelinktests()
{
+ zen::basicfile_forcelink();
zen::blake3_forcelink();
zen::callstack_forcelink();
zen::compositebuffer_forcelink();
diff --git a/src/zenhttp/auth/authmgr.cpp b/src/zenhttp/auth/authmgr.cpp
index 8da676908..1a9892d5c 100644
--- a/src/zenhttp/auth/authmgr.cpp
+++ b/src/zenhttp/auth/authmgr.cpp
@@ -2,6 +2,7 @@
#include "zenhttp/auth/authmgr.h"
+#include <zencore/basicfile.h>
#include <zencore/compactbinary.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinaryvalidation.h>
@@ -9,7 +10,6 @@
#include <zencore/filesystem.h>
#include <zencore/logging.h>
#include <zenhttp/auth/oidc.h>
-#include <zenutil/basicfile.h>
#include <condition_variable>
#include <memory>
diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp
index d8ce25304..8052a8fd5 100644
--- a/src/zenhttp/httpclient.cpp
+++ b/src/zenhttp/httpclient.cpp
@@ -1,7 +1,9 @@
// Copyright Epic Games, Inc. All Rights Reserved.
+#include <zenhttp/formatters.h>
#include <zenhttp/httpclient.h>
#include <zenhttp/httpserver.h>
+#include <zenhttp/packageformat.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinarypackage.h>
@@ -16,8 +18,6 @@
#include <zencore/string.h>
#include <zencore/testing.h>
#include <zencore/trace.h>
-#include <zenhttp/formatters.h>
-#include <zenutil/packageformat.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <cpr/cpr.h>
diff --git a/src/zenhttp/httpserver.cpp b/src/zenhttp/httpserver.cpp
index a0d4ef3f3..1fbe22628 100644
--- a/src/zenhttp/httpserver.cpp
+++ b/src/zenhttp/httpserver.cpp
@@ -24,7 +24,7 @@
#include <zencore/string.h>
#include <zencore/testing.h>
#include <zencore/thread.h>
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
#include <charconv>
#include <mutex>
diff --git a/src/zenutil/include/zenutil/packageformat.h b/src/zenhttp/include/zenhttp/packageformat.h
index c90b840da..c90b840da 100644
--- a/src/zenutil/include/zenutil/packageformat.h
+++ b/src/zenhttp/include/zenhttp/packageformat.h
diff --git a/src/zenutil/packageformat.cpp b/src/zenhttp/packageformat.cpp
index 579e0d13c..676fc73fd 100644
--- a/src/zenutil/packageformat.cpp
+++ b/src/zenhttp/packageformat.cpp
@@ -1,6 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved.
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinarypackage.h>
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp
index c2a823430..fe59e3a6f 100644
--- a/src/zenhttp/servers/httpasio.cpp
+++ b/src/zenhttp/servers/httpasio.cpp
@@ -522,7 +522,9 @@ HttpServerConnection::HandleRequest()
}
else
{
- ZEN_ERROR("Caught system error exception while handling request: {}", SystemError.what());
+ ZEN_ERROR("Caught system error exception while handling request: {}. ({})",
+ SystemError.what(),
+ SystemError.code().value());
Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, SystemError.what());
}
}
diff --git a/src/zenhttp/servers/httpparser.cpp b/src/zenhttp/servers/httpparser.cpp
index 6829faa4a..9bb354a5e 100644
--- a/src/zenhttp/servers/httpparser.cpp
+++ b/src/zenhttp/servers/httpparser.cpp
@@ -389,7 +389,7 @@ HttpRequestParser::OnMessageComplete()
}
else
{
- ZEN_ERROR("failed processing http request: '{}'", SystemError.what());
+ ZEN_ERROR("failed processing http request: '{}' ({})", SystemError.what(), SystemError.code().value());
}
ResetState();
return 1;
diff --git a/src/zenhttp/servers/httpplugin.cpp b/src/zenhttp/servers/httpplugin.cpp
index b55d80af8..ec12b3755 100644
--- a/src/zenhttp/servers/httpplugin.cpp
+++ b/src/zenhttp/servers/httpplugin.cpp
@@ -407,7 +407,9 @@ HttpPluginConnectionHandler::HandleRequest()
}
else
{
- ZEN_ERROR("Caught system error exception while handling request: {}", SystemError.what());
+ ZEN_ERROR("Caught system error exception while handling request: {}. ({})",
+ SystemError.what(),
+ SystemError.code().value());
Request.WriteResponse(HttpResponseCode::InternalServerError, HttpContentType::kText, SystemError.what());
}
}
diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp
index 54308a00b..87128c0c9 100644
--- a/src/zenhttp/servers/httpsys.cpp
+++ b/src/zenhttp/servers/httpsys.cpp
@@ -14,7 +14,7 @@
#include <zencore/string.h>
#include <zencore/timer.h>
#include <zencore/trace.h>
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
#if ZEN_WITH_HTTPSYS
# define _WINSOCKAPI_
@@ -2047,7 +2047,7 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT
return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InsufficientStorage, SystemError.what());
}
- ZEN_ERROR("Caught system error exception while handling request: {}", SystemError.what());
+ ZEN_ERROR("Caught system error exception while handling request: {}. ({})", SystemError.what(), SystemError.code().value());
return new HttpMessageResponseRequest(Transaction(), (uint16_t)HttpResponseCode::InternalServerError, SystemError.what());
}
catch (const std::bad_alloc& BadAlloc)
diff --git a/src/zenhttp/xmake.lua b/src/zenhttp/xmake.lua
index 8393f399b..b6ffbe467 100644
--- a/src/zenhttp/xmake.lua
+++ b/src/zenhttp/xmake.lua
@@ -7,7 +7,7 @@ target('zenhttp')
add_files("**.cpp")
add_files("servers/httpsys.cpp", {unity_ignored=true})
add_includedirs("include", {public=true})
- add_deps("zencore", "zenutil", "transport-sdk")
+ add_deps("zencore", "transport-sdk")
add_packages(
"vcpkg::asio",
"vcpkg::cpr",
diff --git a/src/zenhttp/zenhttp.cpp b/src/zenhttp/zenhttp.cpp
index 6b855c4db..a2679f92e 100644
--- a/src/zenhttp/zenhttp.cpp
+++ b/src/zenhttp/zenhttp.cpp
@@ -6,7 +6,7 @@
# include <zenhttp/httpclient.h>
# include <zenhttp/httpserver.h>
-# include <zenutil/packageformat.h>
+# include <zenhttp/packageformat.h>
namespace zen {
@@ -15,6 +15,7 @@ zenhttp_forcelinktests()
{
http_forcelink();
httpclient_forcelink();
+ forcelink_packageformat();
}
} // namespace zen
diff --git a/src/zenserver-test/zenserver-test.cpp b/src/zenserver-test/zenserver-test.cpp
index ec288f1dc..6259c0f37 100644
--- a/src/zenserver-test/zenserver-test.cpp
+++ b/src/zenserver-test/zenserver-test.cpp
@@ -20,12 +20,12 @@
#include <zencore/timer.h>
#include <zencore/xxhash.h>
#include <zenhttp/httpclient.h>
+#include <zenhttp/packageformat.h>
#include <zenhttp/zenhttp.h>
#include <zenutil/cache/cache.h>
#include <zenutil/cache/cacherequests.h>
#include <zenutil/chunkrequests.h>
#include <zenutil/logging/testformatter.h>
-#include <zenutil/packageformat.h>
#include <zenutil/zenserverprocess.h>
#include <http_parser.h>
diff --git a/src/zenserver/cache/httpstructuredcache.cpp b/src/zenserver/cache/httpstructuredcache.cpp
index 925c7b42d..b4dc4c7f0 100644
--- a/src/zenserver/cache/httpstructuredcache.cpp
+++ b/src/zenserver/cache/httpstructuredcache.cpp
@@ -18,15 +18,15 @@
#include <zencore/workthreadpool.h>
#include <zenhttp/httpserver.h>
#include <zenhttp/httpstats.h>
+#include <zenhttp/packageformat.h>
#include <zenstore/cache/structuredcachestore.h>
#include <zenstore/gc.h>
#include <zenutil/cache/cache.h>
#include <zenutil/cache/cacherequests.h>
#include <zenutil/cache/rpcrecording.h>
-#include <zenutil/packageformat.h>
+#include <zenutil/jupiter.h>
#include <zenutil/workerpools.h>
-#include "upstream/jupiter.h"
#include "upstream/upstreamcache.h"
#include "upstream/zen.h"
#include "zenstore/cidstore.h"
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index 0108e8b9f..f3ad71356 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -5,6 +5,7 @@
#include "config/luaconfig.h"
#include "diag/logging.h"
+#include <zencore/basicfile.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinaryvalidation.h>
#include <zencore/crypto.h>
@@ -14,7 +15,6 @@
#include <zencore/logging.h>
#include <zencore/string.h>
#include <zenhttp/zenhttp.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/format.h>
@@ -400,25 +400,25 @@ ParseConfigFile(const std::filesystem::path& Path,
#endif
////// stats
- LuaOptions.AddOption("stats.enable"sv, ServerOptions.StatsConfig.Enabled);
+ LuaOptions.AddOption("stats.enable"sv, ServerOptions.StatsConfig.Enabled, "statsd"sv);
LuaOptions.AddOption("stats.host"sv, ServerOptions.StatsConfig.StatsdHost);
LuaOptions.AddOption("stats.port"sv, ServerOptions.StatsConfig.StatsdPort);
////// cache
LuaOptions.AddOption("cache.enable"sv, ServerOptions.StructuredCacheConfig.Enabled);
- LuaOptions.AddOption("cache.writelog"sv, ServerOptions.StructuredCacheConfig.WriteLogEnabled, "cache-write-log");
- LuaOptions.AddOption("cache.accesslog"sv, ServerOptions.StructuredCacheConfig.AccessLogEnabled, "cache-access-log");
+ LuaOptions.AddOption("cache.writelog"sv, ServerOptions.StructuredCacheConfig.WriteLogEnabled, "cache-write-log"sv);
+ LuaOptions.AddOption("cache.accesslog"sv, ServerOptions.StructuredCacheConfig.AccessLogEnabled, "cache-access-log"sv);
LuaOptions.AddOption("cache.memlayer.sizethreshold"sv,
ServerOptions.StructuredCacheConfig.MemCacheSizeThreshold,
- "cache-memlayer-sizethreshold");
+ "cache-memlayer-sizethreshold"sv);
LuaOptions.AddOption("cache.memlayer.targetfootprint"sv,
ServerOptions.StructuredCacheConfig.MemTargetFootprintBytes,
- "cache-memlayer-targetfootprint");
+ "cache-memlayer-targetfootprint"sv);
LuaOptions.AddOption("cache.memlayer.triminterval"sv,
ServerOptions.StructuredCacheConfig.MemTrimIntervalSeconds,
- "cache-memlayer-triminterval");
- LuaOptions.AddOption("cache.memlayer.maxage"sv, ServerOptions.StructuredCacheConfig.MemMaxAgeSeconds, "cache-memlayer-maxage");
+ "cache-memlayer-triminterval"sv);
+ LuaOptions.AddOption("cache.memlayer.maxage"sv, ServerOptions.StructuredCacheConfig.MemMaxAgeSeconds, "cache-memlayer-maxage"sv);
////// cache.upstream
LuaOptions.AddOption("cache.upstream.policy"sv, ServerOptions.UpstreamCacheConfig.CachePolicy, "upstream-cache-policy"sv);
@@ -461,6 +461,7 @@ ParseConfigFile(const std::filesystem::path& Path,
LuaOptions.AddOption("cache.upstream.zen.dns"sv, ServerOptions.UpstreamCacheConfig.ZenConfig.Dns);
LuaOptions.AddOption("cache.upstream.zen.url"sv, ServerOptions.UpstreamCacheConfig.ZenConfig.Urls);
+ ////// gc
LuaOptions.AddOption("gc.enabled"sv, ServerOptions.GcConfig.Enabled, "gc-enabled"sv);
LuaOptions.AddOption("gc.v2"sv, ServerOptions.GcConfig.UseGCV2, "gc-v2"sv);
@@ -487,22 +488,24 @@ ParseConfigFile(const std::filesystem::path& Path,
LuaOptions.AddOption("gc.attachment.passes"sv, ServerOptions.GcConfig.AttachmentPassCount, "gc-attachment-passes"sv);
LuaOptions.AddOption("gc.validation"sv, ServerOptions.GcConfig.EnableValidation, "gc-validation");
- ////// gc
LuaOptions.AddOption("gc.cache.maxdurationseconds"sv, ServerOptions.GcConfig.Cache.MaxDurationSeconds, "gc-cache-duration-seconds"sv);
+ LuaOptions.AddOption("gc.projectstore.duration.seconds"sv,
+ ServerOptions.GcConfig.ProjectStore.MaxDurationSeconds,
+ "gc-projectstore-duration-seconds");
////// security
LuaOptions.AddOption("security.encryptionaeskey"sv, ServerOptions.EncryptionKey, "encryption-aes-key"sv);
LuaOptions.AddOption("security.encryptionaesiv"sv, ServerOptions.EncryptionIV, "encryption-aes-iv"sv);
LuaOptions.AddOption("security.openidproviders"sv, ServerOptions.AuthConfig);
- LuaOptions.Parse(Path, CmdLineResult);
-
////// workspaces
LuaOptions.AddOption("workspaces.enabled"sv, ServerOptions.WorksSpacesConfig.Enabled, "workspaces-enabled"sv);
LuaOptions.AddOption("workspaces.allowconfigchanges"sv,
ServerOptions.WorksSpacesConfig.AllowConfigurationChanges,
"workspaces-allow-changes"sv);
+ LuaOptions.Parse(Path, CmdLineResult);
+
// These have special command line processing so we make sure we export them if they were configured on command line
if (!ServerOptions.AuthConfig.OpenIdProviders.empty())
{
diff --git a/src/zenserver/objectstore/objectstore.cpp b/src/zenserver/objectstore/objectstore.cpp
index e614b256b..530efbc97 100644
--- a/src/zenserver/objectstore/objectstore.cpp
+++ b/src/zenserver/objectstore/objectstore.cpp
@@ -3,6 +3,7 @@
#include <objectstore/objectstore.h>
#include <zencore/base64.h>
+#include <zencore/basicfile.h>
#include <zencore/compactbinaryvalue.h>
#include <zencore/filesystem.h>
#include <zencore/fmtutils.h>
@@ -12,7 +13,6 @@
#include "zencore/compactbinarybuilder.h"
#include "zenhttp/httpcommon.h"
#include "zenhttp/httpserver.h"
-#include "zenutil/basicfile.h"
#include <filesystem>
#include <thread>
diff --git a/src/zenserver/projectstore/buildsremoteprojectstore.cpp b/src/zenserver/projectstore/buildsremoteprojectstore.cpp
index 6d0d51a60..0fe37449f 100644
--- a/src/zenserver/projectstore/buildsremoteprojectstore.cpp
+++ b/src/zenserver/projectstore/buildsremoteprojectstore.cpp
@@ -6,8 +6,8 @@
#include <zencore/compress.h>
#include <zencore/fmtutils.h>
-#include <upstream/jupiter.h>
#include <zenhttp/auth/authmgr.h>
+#include <zenutil/jupiter.h>
namespace zen {
diff --git a/src/zenserver/projectstore/jupiterremoteprojectstore.cpp b/src/zenserver/projectstore/jupiterremoteprojectstore.cpp
index f4fe578ff..5a42b2f50 100644
--- a/src/zenserver/projectstore/jupiterremoteprojectstore.cpp
+++ b/src/zenserver/projectstore/jupiterremoteprojectstore.cpp
@@ -5,8 +5,8 @@
#include <zencore/compress.h>
#include <zencore/fmtutils.h>
-#include <upstream/jupiter.h>
#include <zenhttp/auth/authmgr.h>
+#include <zenutil/jupiter.h>
namespace zen {
diff --git a/src/zenserver/projectstore/projectstore.cpp b/src/zenserver/projectstore/projectstore.cpp
index ff387b448..9e9fc0e77 100644
--- a/src/zenserver/projectstore/projectstore.cpp
+++ b/src/zenserver/projectstore/projectstore.cpp
@@ -16,12 +16,12 @@
#include <zencore/stream.h>
#include <zencore/timer.h>
#include <zencore/trace.h>
+#include <zenhttp/packageformat.h>
#include <zenstore/caslog.h>
#include <zenstore/cidstore.h>
#include <zenstore/scrubcontext.h>
#include <zenutil/cache/rpcrecording.h>
#include <zenutil/openprocesscache.h>
-#include <zenutil/packageformat.h>
#include <zenutil/referencemetadata.h>
#include <zenutil/workerpools.h>
diff --git a/src/zenserver/projectstore/remoteprojectstore.cpp b/src/zenserver/projectstore/remoteprojectstore.cpp
index 216b1c4dd..0589fdc5f 100644
--- a/src/zenserver/projectstore/remoteprojectstore.cpp
+++ b/src/zenserver/projectstore/remoteprojectstore.cpp
@@ -266,7 +266,10 @@ namespace remotestore_impl {
AppendBatch();
}
- ReportProgress(OptionalContext, "Writing oplog"sv, ""sv, OpCount, 0);
+ if (OpCount > 0)
+ {
+ ReportProgress(OptionalContext, "Writing oplog"sv, ""sv, OpCount, 0);
+ }
return RemoteProjectStore::Result{.ElapsedSeconds = Timer.GetElapsedTimeMs() / 1000.0};
}
@@ -1685,7 +1688,7 @@ BuildContainer(CidStore& ChunkStore,
IoBuffer RawData = IoBufferBuilder::MakeFromFile(FilePath);
if (RawData)
{
- if (RawData.GetSize() > ChunkFileSizeLimit)
+ if (AllowChunking && RawData.GetSize() > ChunkFileSizeLimit)
{
IoBufferFileReference FileRef;
(void)RawData.GetFileReference(FileRef);
diff --git a/src/zenserver/projectstore/zenremoteprojectstore.cpp b/src/zenserver/projectstore/zenremoteprojectstore.cpp
index 566d0d4b2..42519b108 100644
--- a/src/zenserver/projectstore/zenremoteprojectstore.cpp
+++ b/src/zenserver/projectstore/zenremoteprojectstore.cpp
@@ -8,7 +8,7 @@
#include <zencore/fmtutils.h>
#include <zencore/stream.h>
#include <zenhttp/httpclient.h>
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
namespace zen {
diff --git a/src/zenserver/upstream/upstream.h b/src/zenserver/upstream/upstream.h
index a57301206..4d45687fc 100644
--- a/src/zenserver/upstream/upstream.h
+++ b/src/zenserver/upstream/upstream.h
@@ -2,7 +2,6 @@
#pragma once
-#include <upstream/jupiter.h>
#include <upstream/upstreamcache.h>
#include <upstream/upstreamservice.h>
#include <upstream/zen.h>
diff --git a/src/zenserver/upstream/upstreamcache.cpp b/src/zenserver/upstream/upstreamcache.cpp
index ab8fe8704..3e1d1fbd6 100644
--- a/src/zenserver/upstream/upstreamcache.cpp
+++ b/src/zenserver/upstream/upstreamcache.cpp
@@ -1,7 +1,6 @@
// Copyright Epic Games, Inc. All Rights Reserved.
#include "upstreamcache.h"
-#include "jupiter.h"
#include "zen.h"
#include <zencore/blockingqueue.h>
@@ -16,10 +15,13 @@
#include <zencore/trace.h>
#include <zenhttp/auth/authmgr.h>
-#include <zenstore/cidstore.h>
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
#include <zenstore/cache/structuredcachestore.h>
+#include <zenstore/cidstore.h>
+
+#include <zenutil/jupiter.h>
+
#include "cache/httpstructuredcache.h"
#include "diag/logging.h"
diff --git a/src/zenserver/upstream/zen.cpp b/src/zenserver/upstream/zen.cpp
index c031a4086..7494ae379 100644
--- a/src/zenserver/upstream/zen.cpp
+++ b/src/zenserver/upstream/zen.cpp
@@ -10,7 +10,7 @@
#include <zencore/stream.h>
#include <zenhttp/formatters.h>
#include <zenhttp/httpcommon.h>
-#include <zenutil/packageformat.h>
+#include <zenhttp/packageformat.h>
#include <zenstore/cache/structuredcachestore.h>
#include "diag/logging.h"
diff --git a/src/zenserver/workspaces/httpworkspaces.cpp b/src/zenserver/workspaces/httpworkspaces.cpp
index 9444f7644..2d59c9357 100644
--- a/src/zenserver/workspaces/httpworkspaces.cpp
+++ b/src/zenserver/workspaces/httpworkspaces.cpp
@@ -2,12 +2,12 @@
#include <workspaces/httpworkspaces.h>
+#include <zencore/basicfile.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/fmtutils.h>
#include <zencore/logging.h>
#include <zencore/trace.h>
#include <zenstore/workspaces.h>
-#include <zenutil/basicfile.h>
#include <zenutil/chunkrequests.h>
#include <zenutil/workerpools.h>
diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp
index 66b6cb858..9c27aa5c8 100644
--- a/src/zenserver/zenserver.cpp
+++ b/src/zenserver/zenserver.cpp
@@ -5,6 +5,7 @@
#include "sentryintegration.h"
#include <zenbase/refcount.h>
+#include <zencore/basicfile.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/compactbinaryvalidation.h>
#include <zencore/config.h>
@@ -25,7 +26,7 @@
#include <zenstore/cidstore.h>
#include <zenstore/scrubcontext.h>
#include <zenstore/workspaces.h>
-#include <zenutil/basicfile.h>
+#include <zenutil/jupiter.h>
#include <zenutil/workerpools.h>
#include <zenutil/zenserverprocess.h>
diff --git a/src/zenstore/cache/cacherpc.cpp b/src/zenstore/cache/cacherpc.cpp
index 0a1ed0e09..cca51e63e 100644
--- a/src/zenstore/cache/cacherpc.cpp
+++ b/src/zenstore/cache/cacherpc.cpp
@@ -10,12 +10,12 @@
#include <zencore/scopeguard.h>
#include <zencore/timer.h>
#include <zencore/trace.h>
+#include <zenhttp/packageformat.h>
#include <zenstore/cache/cacheshared.h>
#include <zenstore/cache/structuredcachestore.h>
#include <zenstore/cache/upstreamcacheclient.h>
#include <zenstore/cidstore.h>
#include <zenutil/cache/cacherequests.h>
-#include <zenutil/packageformat.h>
#include <zenutil/workerpools.h>
#include <zencore/memory/llm.h>
diff --git a/src/zenstore/chunkedfile.cpp b/src/zenstore/chunkedfile.cpp
index 0b66c7b9b..0f3cf5112 100644
--- a/src/zenstore/chunkedfile.cpp
+++ b/src/zenstore/chunkedfile.cpp
@@ -1,7 +1,7 @@
// Copyright Epic Games, Inc. All Rights Reserved.
+#include <zencore/basicfile.h>
#include <zenstore/chunkedfile.h>
-#include <zenutil/basicfile.h>
#include "chunking.h"
diff --git a/src/zenstore/filecas.cpp b/src/zenstore/filecas.cpp
index 82dbe3551..110baaf5f 100644
--- a/src/zenstore/filecas.cpp
+++ b/src/zenstore/filecas.cpp
@@ -2,6 +2,7 @@
#include "filecas.h"
+#include <zencore/basicfile.h>
#include <zencore/compress.h>
#include <zencore/except.h>
#include <zencore/filesystem.h>
@@ -19,7 +20,6 @@
#include <zencore/workthreadpool.h>
#include <zenstore/gc.h>
#include <zenstore/scrubcontext.h>
-#include <zenutil/basicfile.h>
#if ZEN_WITH_TESTS
# include <zencore/compactbinarybuilder.h>
diff --git a/src/zenstore/gc.cpp b/src/zenstore/gc.cpp
index 50588b8c0..7ac10d613 100644
--- a/src/zenstore/gc.cpp
+++ b/src/zenstore/gc.cpp
@@ -1810,7 +1810,7 @@ GcScheduler::AppendGCLog(std::string_view Id, GcClock::TimePoint StartTime, cons
}
else
{
- ZEN_ERROR("writing gc result failed with system error exception: '{}'", SystemError.what());
+ ZEN_ERROR("writing gc result failed with system error exception: '{}' ({})", SystemError.what(), SystemError.code().value());
}
}
catch (const std::bad_alloc& BadAlloc)
@@ -2274,7 +2274,9 @@ GcScheduler::SchedulerThread()
}
else
{
- ZEN_ERROR("scheduling garbage collection failed with system error exception: '{}'", SystemError.what());
+ ZEN_ERROR("scheduling garbage collection failed with system error exception: '{}' ({})",
+ SystemError.what(),
+ SystemError.code().value());
}
m_LastGcTime = GcClock::Now();
m_LastLightweightGcTime = m_LastGcTime;
@@ -2596,11 +2598,15 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
}
if (RetryCount == 0)
{
- ZEN_ERROR("writing gc scheduler state failed with system error exception: '{}'", SystemError.what());
+ ZEN_ERROR("writing gc scheduler state failed with system error exception: '{}' ({})",
+ SystemError.what(),
+ SystemError.code().value());
}
else
{
- ZEN_WARN("writing gc scheduler state failed with system error exception: '{}'", SystemError.what());
+ ZEN_WARN("writing gc scheduler state failed with system error exception: '{}' ({})",
+ SystemError.what(),
+ SystemError.code().value());
}
}
catch (const std::bad_alloc& BadAlloc)
@@ -2636,11 +2642,15 @@ GcScheduler::CollectGarbage(const GcClock::TimePoint& CacheExpireTime,
{
if (SilenceErrors)
{
- ZEN_WARN("scheduling garbage collection failed with system error exception: '{}'", SystemError.what());
+ ZEN_WARN("scheduling garbage collection failed with system error exception: '{}' ({})",
+ SystemError.what(),
+ SystemError.code().value());
}
else
{
- ZEN_ERROR("scheduling garbage collection failed with system error exception: '{}'", SystemError.what());
+ ZEN_ERROR("scheduling garbage collection failed with system error exception: '{}' ({})",
+ SystemError.what(),
+ SystemError.code().value());
}
}
m_LastGcTime = GcClock::Now();
diff --git a/src/zenstore/include/zenstore/blockstore.h b/src/zenstore/include/zenstore/blockstore.h
index 8f8f2ccd7..97357e5cb 100644
--- a/src/zenstore/include/zenstore/blockstore.h
+++ b/src/zenstore/include/zenstore/blockstore.h
@@ -2,9 +2,9 @@
#pragma once
+#include <zencore/basicfile.h>
#include <zencore/filesystem.h>
#include <zencore/zencore.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <tsl/robin_map.h>
diff --git a/src/zenstore/include/zenstore/caslog.h b/src/zenstore/include/zenstore/caslog.h
index edb4f8d9b..3d95c9c90 100644
--- a/src/zenstore/include/zenstore/caslog.h
+++ b/src/zenstore/include/zenstore/caslog.h
@@ -2,8 +2,8 @@
#pragma once
+#include <zencore/basicfile.h>
#include <zencore/uid.h>
-#include <zenutil/basicfile.h>
namespace zen {
diff --git a/src/zenstore/workspaces.cpp b/src/zenstore/workspaces.cpp
index 80e03296c..d399ffc88 100644
--- a/src/zenstore/workspaces.cpp
+++ b/src/zenstore/workspaces.cpp
@@ -2,13 +2,13 @@
#include "zenstore/workspaces.h"
+#include <zencore/basicfile.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/fmtutils.h>
#include <zencore/scopeguard.h>
#include <zencore/timer.h>
#include <zencore/trace.h>
#include <zencore/workthreadpool.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <tsl/robin_set.h>
diff --git a/src/zenutil/cache/rpcrecording.cpp b/src/zenutil/cache/rpcrecording.cpp
index 9bef4d1a4..1f951167d 100644
--- a/src/zenutil/cache/rpcrecording.cpp
+++ b/src/zenutil/cache/rpcrecording.cpp
@@ -1,5 +1,8 @@
// Copyright Epic Games, Inc. All Rights Reserved.
+#include <zenutil/cache/rpcrecording.h>
+
+#include <zencore/basicfile.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/filesystem.h>
#include <zencore/fmtutils.h>
@@ -8,8 +11,6 @@
#include <zencore/system.h>
#include <zencore/testing.h>
#include <zencore/testutils.h>
-#include <zenutil/basicfile.h>
-#include <zenutil/cache/rpcrecording.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/format.h>
diff --git a/src/zenserver/upstream/jupiter.h b/src/zenutil/include/zenutil/jupiter.h
index 50e4ad68a..50e4ad68a 100644
--- a/src/zenserver/upstream/jupiter.h
+++ b/src/zenutil/include/zenutil/jupiter.h
diff --git a/src/zenutil/include/zenutil/logging/rotatingfilesink.h b/src/zenutil/include/zenutil/logging/rotatingfilesink.h
index 3eb9021dd..758722156 100644
--- a/src/zenutil/include/zenutil/logging/rotatingfilesink.h
+++ b/src/zenutil/include/zenutil/logging/rotatingfilesink.h
@@ -2,8 +2,8 @@
#pragma once
+#include <zencore/basicfile.h>
#include <zencore/memory/llm.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <spdlog/details/log_msg.h>
diff --git a/src/zenserver/upstream/jupiter.cpp b/src/zenutil/jupiter.cpp
index 2ae977f00..df4af0c13 100644
--- a/src/zenserver/upstream/jupiter.cpp
+++ b/src/zenutil/jupiter.cpp
@@ -1,9 +1,8 @@
// Copyright Epic Games, Inc. All Rights Reserved.
-#include "jupiter.h"
-
-#include "diag/logging.h"
+#include <zenutil/jupiter.h>
+#include <zencore/basicfile.h>
#include <zencore/compactbinary.h>
#include <zencore/compositebuffer.h>
#include <zencore/fmtutils.h>
@@ -13,16 +12,15 @@
#include <zencore/thread.h>
#include <zencore/trace.h>
#include <zenhttp/formatters.h>
-#include <zenutil/basicfile.h>
ZEN_THIRD_PARTY_INCLUDES_START
#include <fmt/format.h>
ZEN_THIRD_PARTY_INCLUDES_END
-#if ZEN_PLATFORM_WINDOWS
-# pragma comment(lib, "Crypt32.lib")
-# pragma comment(lib, "Wldap32.lib")
-#endif
+//#if ZEN_PLATFORM_WINDOWS
+//# pragma comment(lib, "Crypt32.lib")
+//# pragma comment(lib, "Wldap32.lib")
+//#endif
#include <json11.hpp>
diff --git a/src/zenutil/xmake.lua b/src/zenutil/xmake.lua
index 744dff737..3d95651f2 100644
--- a/src/zenutil/xmake.lua
+++ b/src/zenutil/xmake.lua
@@ -6,5 +6,5 @@ target('zenutil')
add_headerfiles("**.h")
add_files("**.cpp")
add_includedirs("include", {public=true})
- add_deps("zencore")
+ add_deps("zencore", "zenhttp")
add_packages("vcpkg::robin-map", "vcpkg::spdlog")
diff --git a/src/zenutil/zenserverprocess.cpp b/src/zenutil/zenserverprocess.cpp
index 0c0882311..11fcce02f 100644
--- a/src/zenutil/zenserverprocess.cpp
+++ b/src/zenutil/zenserverprocess.cpp
@@ -2,6 +2,7 @@
#include "zenutil/zenserverprocess.h"
+#include <zencore/basicfile.h>
#include <zencore/compactbinary.h>
#include <zencore/compactbinarybuilder.h>
#include <zencore/except.h>
@@ -12,7 +13,6 @@
#include <zencore/string.h>
#include <zencore/thread.h>
#include <zencore/timer.h>
-#include <zenutil/basicfile.h>
#include <atomic>
diff --git a/src/zenutil/zenutil.cpp b/src/zenutil/zenutil.cpp
index 97ebeb01d..c54144549 100644
--- a/src/zenutil/zenutil.cpp
+++ b/src/zenutil/zenutil.cpp
@@ -4,20 +4,16 @@
#if ZEN_WITH_TESTS
-# include <zenutil/basicfile.h>
# include <zenutil/cache/cacherequests.h>
# include <zenutil/cache/rpcrecording.h>
-# include <zenutil/packageformat.h>
namespace zen {
void
zenutil_forcelinktests()
{
- basicfile_forcelink();
cachepolicy_forcelink();
cache::rpcrecord_forcelink();
- forcelink_packageformat();
cacherequests_forcelink();
}