aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
Commit message (Collapse)AuthorAgeFilesLines
* work around doctest shutdown issues with static CRT (#784)Stefan Boberg14 days1-0/+9
| | | | | | * tweaked doctest.h to avoid shutdown issues due to thread_local variables running destructors after the main thread has torn down everything including the heap * disabled zenserver exit thread waiting since doctest should hopefully not be causing issues during shutdown anymore after my workaround This should help reduce the duration of tests spawning lots of server instances
* structured compute basics (#714)Stefan Boberg2026-02-181-5/+50
| | | | | | | | | this change adds the `zencompute` component, which can be used to distribute work dispatched from UE using the DDB (Derived Data Build) APIs via zenserver this change also adds a distinct zenserver compute mode (`zenserver compute`) which is intended to be used for leaf compute nodes to exercise the compute functionality without directly involving UE, a `zen exec` subcommand is also added, which can be used to feed replays through the system all new functionality is considered *experimental* and disabled by default at this time, behind the `zencompute` option in xmake config
* logging config move to zenutil (#754)Stefan Boberg2026-02-131-1/+1
| | | made logging config options from zenserver available in zen CLI
* hotfix 5.7.18 (#730)Dan Engelbrecht2026-01-221-2/+5
| | | | * make sure we properly convert command line args for zenserver as well * make sure we *add* wildcards/excludes in addition to defaults
* zen hub (#574)Stefan Boberg2026-01-211-0/+4
| | | | | Initial implementation of zenserver "hub" mode. This is an experimental feature. zenserver can be started in hub mode by specifying `hub` as the first argument to zenserver
* zenserver API changes, some other minor changes (#720)Stefan Boberg2026-01-191-13/+41
| | | | | | | * add system metrics output to top command * removed unnecessary xmake directives * file system API/comment tweaks * fixed out-of-range access in httpserver test * updated ZenServer base API to allow customization by mode
* use current locale when converting wide char command line arguments to ↵Dan Engelbrecht2026-01-151-0/+8
| | | | | | string (#712) * set utf8 locale, only set LC_CTYPE as we don't want to affect how decimal point or sorting orders are handled * set language/region explicitly so we can use LC_ALL
* add otel instrumentation (#581)Stefan Boberg2025-12-111-0/+3
| | | | | | | | this change adds OTEL tracing to a few places * Top-level application lifecycle (config/init/cleanup, main loop) * http.sys requests it also brings some otlptrace optimizations and dynamic configuration of tracing. OTLP tracing is currently always disabled
* Various fixes to address issues flagged by gcc / non-UE toolchain build (#621)Stefan Boberg2025-11-011-2/+2
| | | | | | | | | | | | | | | | | | | | * gcc: avoid using memset on nontrivial struct * redundant `return std::move` * fixed various compilation issues flagged by gcc * fix issue in xmake.lua detecting whether we are building with the UE toolchain or not * add GCC ignore -Wundef (comment is inaccurate) * remove redundant std::move * don't catch exceptions by value * unreferenced variables * initialize "by the book" instead of memset * remove unused exception reference * add #include <cstring> to fix gcc build * explicitly poulate KeyValueMap by traversing input spans fixes gcc compilation * remove unreferenced variable * eliminate redundant `std::move` which gcc complains about * fix gcc compilation by including <cstring> * tag unreferenced variable to fix gcc compilation * fixes for various cases of naming members the same as their type
* restructured zenserver configuration (#575)Stefan Boberg2025-10-151-47/+62
| | | this breaks out the configuration logic to allow multiple applications to share common configuration and initialization logic whilst customizing chosen aspects of the process
* move all storage-related services into storage tree (#571)Stefan Boberg2025-10-141-13/+7
| | | | | | * move all storage-related services into storage tree * move config into config/ * also move admin service into storage since it mostly has storage related functionality * header consolidation
* split storage config from base config (#570)Stefan Boberg2025-10-131-1/+1
| | | | | this change splits the configuration logic into a base part and a storage server part manually tested with shared server config file
* extract storage server into separate source files (#569)Stefan Boberg2025-10-131-342/+5
| | | | this change moves common base service code into `zenserver.(cpp|h)` and storage server code into `zenstorageserver.(cpp|h)` to more clearly separate concerns but also to make way for another service
* move service common code into base class (#567)Stefan Boberg2025-10-131-102/+139
| | | | | Separates storage server code and generic server code into two classes. This is a change to prepare for different services to be implemented using the same framework, into the same executable
* add ability to limit concurrency (#565)Stefan Boberg2025-10-101-1/+8
| | | | | | | | | | | | effective concurrency in zenserver can be limited via the `--corelimit=<N>` option on the command line. Any value passed in here will be used instead of the return value from `std::thread::hardware_concurrency()` if it is lower. * added --corelimit option to zenserver * made sure thread pools are configured lazily and not during global init * added log output indicating effective and HW concurrency * added change log entry * removed debug logging from ZenEntryPoint::Run() also removed main thread naming on Linux since it makes the output from `top` and similar tools confusing (it shows `main` instead of `zenserver`)
* zenutil cleanup (#550)Dan Engelbrecht2025-10-031-1/+1
| | | | * move referencemetadata to zenstore * rename zenutil/windows/service to windowsservice
* rework `--quiet` zenserver option add `--noconsole` option (#477)Dan Engelbrecht2025-08-261-24/+33
| | | | - Improvement: Changed zenserver `--quiet` option to suppress INFO level messages and below to surface startup and runtime errors - Feature: Added `--noconsole` option that suppresses all output to standard out, this works as the `--quiet` option used to work
* improve console output (#476)Dan Engelbrecht2025-08-261-2/+2
| | | | * add color coded logging level to console output (for warn/err/crit levels) * clean up console output
* Merge pull request #139 from ue-foundation/de/zen-service-commandLiam Mitchell2025-08-221-1/+21
|\ | | | | zen service command
| * Move windows service utilities to zenutil and fix clang-format errorsLiam Mitchell2025-08-221-2/+1
| |
| * Move ReportServiceStatus to zenutil and remove extraneous loggingLiam Mitchell2025-08-221-50/+0
| |
| * Merge remote-tracking branch 'origin/main' into de/zen-service-commandLiam Mitchell2025-08-211-7/+10
| |\
| * | Ignore unused variable warnings on platforms where ReportServiceStatus is ↵Liam Mitchell2025-08-211-0/+1
| | | | | | | | | | | | unimplemented
| * | Add pre-built systemd library and remove vcpkg dependencyLiam Mitchell2025-08-201-0/+2
| | |
| * | Merge branch 'main' into de/zen-service-commandLiam Mitchell2025-07-291-6/+12
| |\ \
| * | | Update Linux service type and add libsystemd dependencyLiam Mitchell2025-03-051-0/+4
| | | |
| * | | Initial implementation of service status reportingLiam Mitchell2025-03-041-0/+45
| | | |
| * | | Implementation of service commands for Linux.Liam Mitchell2025-02-271-0/+4
| | | |
| * | | clang formatDan Engelbrecht2025-01-151-1/+4
| | | |
| * | | systemd unit file, incompleteDan Engelbrecht2025-01-151-0/+13
| | | |
* | | | clean up trace options parsing (#473)Dan Engelbrecht2025-08-221-24/+12
| |_|/ |/| | | | | | | | | | | * clean up trace command line options explicitly shut down worker pools * some additional startup trace scopes
* | | Set ready event when reusing an existing server instance. (#448)Martin Ridgers2025-08-041-6/+10
| |/ |/| | | | | | | * Moved firing of child-id event into a lambda * Fire notify event to parent after attaching to an existing instance * Updated changelog
* | sentry config (#430)Dan Engelbrecht2025-06-121-5/+7
| | | | | | | | | | | | | | | | | | | | - Feature: Added `--sentry-environment` to `zen` and `zenserver` - Feature: Added `--sentry-debug` to `zen` and `zenserver` - Feature: Added environment variable parsing for the following options: - `UE_ZEN_SENTRY_ENABLED`: `--no-sentry` (inverted) - `UE_ZEN_SENTRY_DEBUG`: `--sentry-debug` - `UE_ZEN_SENTRY_ALLOWPERSONALINFO`: `--sentry-allow-personal-info` - `UE_ZEN_SENTRY_DSN`: `--sentry-dsn` - `UE_ZEN_SENTRY_ENVIRONMENT`: `--sentry-environment`
* | revert 61b4a88f and cadaad63Dan Engelbrecht2025-06-101-7/+5
| |
* | add sentry configurations options for debug/environmentDan Engelbrecht2025-06-101-5/+7
| | | | | | | | | | add env-variable parsing for sentry option
* | `--sentry-dsn` option for zen command line and zenserver to control Sentry ↵Dan Engelbrecht2025-06-091-1/+5
| | | | | | | | | | reporting endpoint (#427) moved sentry database path to temporary directory for zen commandline
* | add sentry for zen command (#373)Dan Engelbrecht2025-05-061-1/+1
| | | | | | | | * refactor sentry integration and add to zen command line tool * move add_ldflags("-framework Security")
* | long filename support (#330)Dan Engelbrecht2025-03-311-3/+3
|/ | | - Bugfix: Long file paths now works correctly on Windows
* added support for dynamic LLM tags (#245)Stefan Boberg2024-12-021-0/+11
| | | | | * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
* Insights-compatible memory tracking (#214)Stefan Boberg2024-11-251-10/+14
| | | | | | | | | | | | | This change introduces support for tracing of memory allocation activity. The code is ported from UE5, and Unreal Insights can be used to analyze the output. This is currently only fully supported on Windows, but will be extended to Mac/Linux in the near future. To activate full memory tracking, pass `--trace=memory` on the commandline alongside `--tracehost=<ip>` or `-tracefile=<path>`. For more control over how much detail is traced you can instead pass some combination of `callstack`, `memtag`, `memalloc` instead. In practice, `--trace=memory` is an alias for `--trace=callstack,memtag,memalloc`). For convenience we also support `--trace=memory_light` which omits call stacks. This change also introduces multiple memory allocators, which may be selected via command-line option `--malloc=<allocator>`: * `mimalloc` - mimalloc (default, same as before) * `rpmalloc` - rpmalloc is another high performance allocator for multithreaded applications which may be a better option than mimalloc (to be evaluated). Due to toolchain limitations this is currently only supported on Windows. * `stomp` - an allocator intended to be used during development/debugging to help track down memory issues such as use-after-free or out-of-bounds access. Currently only supported on Windows. * `ansi` - fallback to default system allocator
* sponsor process attach hardening (#208)Dan Engelbrecht2024-11-041-0/+1
| | | * make sure to clear sponsor slot if pickup does not happen
* safer calls to IsProcessRunning (#131)Dan Engelbrecht2024-08-221-5/+20
| | | * safer calls to IsProcessRunning to handle cases where we can't check status of processes
* if a zenserver is already using our named mutex - exit with error code ↵Dan Engelbrecht2024-08-221-0/+5
| | | | instead of reporting error to Sentry (#132)
* added `--detach` option to zenserver (#115)Stefan Boberg2024-08-141-5/+8
| | | | | added `--detach` option to zenserver. When this is passed in with a false value, we do not create a new process group in order to behave more as expected when running with `xmake run zenserver`. Without this change the zenserver process does not receive any signals and won't exit when xmake does, causing processes to linger in the background. The default behaviour (when run from UE) is unchanged.
* improve logging on main failure (#111)Dan Engelbrecht2024-08-141-2/+10
| | | | | | * add support for indenting callstack output * Explicitly catch option-parse error and reduce log spam on bad parameters * add command line to sentry error reports * log command line at startup
* don't use "error:" in log messages unless there is an error (#87)Dan Engelbrecht2024-05-271-2/+2
| | | Improvement: Don't use "error:" in log messages unless there is an error as Horde CI will pick up that log line and interpret it as an error
* import oplog improvements (#54)Dan Engelbrecht2024-04-201-2/+3
| | | | | | | | | | | * report down/up transfer speed during progress * add disk buffering in http client * offload block decoding and chunk writing form network worker pool threads add block hash verification for blocks recevied at oplog import * separate download-latch from write-latch to get more accurate download speed * check headers when downloading with http client to go directly to file writing for large payloads * we must clear write callback even if we only provide it as an argument to the Download() call * make timeout optional in AddSponsorProcess * check return codes when creating windows threadpool
* improved lock file handling (#50)Dan Engelbrecht2024-04-181-12/+10
| | | | | | | | | | | | - Feature: `zen down` - --`data-dir` to specify a data directory to deduce which zen instance to bring down - Feature: `zen attach` - --`data-dir` to specify a data directory to deduce which zen instance to attach to222 - Feature: `zen status` - --`port` filter running zen instances based on port - --`data-dir` filter running zen instances based on information in the data directory - Improvement: Trying to load a compact binary object from an empty file no longer causes access violation
* zen startup hardening (#49)Dan Engelbrecht2024-04-171-6/+32
| | | | | | | | | | | | | - Feature: `zen up` command improvements - --`port` allows you to specify a base port when starting an instance - --`base-dir` allows you to specify a base directory for the zenserver executable if it is not located next to the zen.exe executable - Feature: `zen down` - --`port` allows you to specify a base port when shutting down an instance - --`base-dir` allows you to specify a base directory for the zenserver executable if it is not located next to the zen.exe executable - --`force` if regular shutdown fails it tries to find a running zenserver.exe process and terminate it - If it fails to attach to the running server it now waits for it to exit when setting the RequestExit shared memory flag - Improvement: zenserver now checks the RequestExit flag in the shared memory and exist gracefully if it is set - Improvement: When adding a sponsor process to a running zenserver instance, we wait for it to be picked up from the shared memory section to determine success/fail
* improved assert (#37)Dan Engelbrecht2024-04-041-2/+12
| | | | - Improvement: Add file and line to ASSERT exceptions - Improvement: Catch call stack when throwing assert exceptions and log/output call stack at important places to provide more context to caller