aboutsummaryrefslogtreecommitdiff
path: root/src/zen/cmds/service_cmd.cpp
Commit message (Collapse)AuthorAgeFilesLines
* filesystem.h surface error codes (#998)Dan Engelbrecht2026-04-211-2/+2
| | | - Improvement: File copy, scan, clone, and move operations now report the underlying OS error in failure messages
* fix utf characters in source code (#953)Dan Engelbrecht2026-04-131-1/+1
|
* Compute batching (#849)Stefan Boberg2026-03-181-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ### Compute Batch Submission - Consolidate duplicated action submission logic in `httpcomputeservice` into a single `HandleSubmitAction` supporting both single-action and batch (actions array) payloads - Group actions by queue in `RemoteHttpRunner` and submit as batches with configurable chunk size, falling back to individual submission on failure - Extract shared helpers: `MakeErrorResult`, `ValidateQueueForEnqueue`, `ActivateActionInQueue`, `RemoveActionFromActiveMaps` ### Retracted Action State - Add `Retracted` state to `RunnerAction` for retry-free rescheduling — an explicit request to pull an action back and reschedule it on a different runner without incrementing `RetryCount` - Implement idempotent `RetractAction()` on `RunnerAction` and `ComputeServiceSession` - Add `POST jobs/{lsn}/retract` and `queues/{queueref}/jobs/{lsn}/retract` HTTP endpoints - Add state machine documentation and per-state comments to `RunnerAction` ### Compute Race Fixes - Fix race in `HandleActionUpdates` where actions enqueued between session abandon and scheduler tick were never abandoned, causing `GetActionResult` to return 202 indefinitely - Fix queue `ActiveCount` race where `NotifyQueueActionComplete` was called after releasing `m_ResultsLock`, allowing callers to observe stale counters immediately after `GetActionResult` returned OK ### Logging Optimization and ANSI improvements - Improve `AnsiColorStdoutSink` write efficiency — single write call, dirty-flag flush, `RwLock` instead of `std::mutex` - Move ANSI color emission from sink into formatters via `Formatter::SetColorEnabled()`; remove `ColorRangeStart`/`End` from `LogMessage` - Extract color helpers (`AnsiColorForLevel`, `StripAnsiSgrSequences`) into `helpers.h` - Strip upstream ANSI SGR escapes in non-color output mode. This enables colour in log messages without polluting log files with ANSI control sequences - Move `RotatingFileSink`, `JsonFormatter`, and `FullFormatter` from header-only to pimpl with `.cpp` files ### CLI / Exec Refactoring - Extract `ExecSessionRunner` class from ~920-line `ExecUsingSession` into focused methods and a `ExecSessionConfig` struct - Replace monolithic `ExecCommand` with subcommand-based architecture (`http`, `inproc`, `beacon`, `dump`, `buildlog`) - Allow parent options to appear after subcommand name by parsing subcommand args permissively and forwarding unmatched tokens to the parent parser ### Testing Improvements - Fix `--test-suite` filter being ignored due to accumulation with default wildcard filter - Add test suite banners to test listener output - Made `function.session.abandon_pending` test more robust ### Startup / Reliability Fixes - Fix silent exit when a second zenserver instance detects a port conflict — use `ZEN_CONSOLE_*` for log calls that precede `InitializeLogging()` - Fix two potential SIGSEGV paths during early startup: guard `sentry_options_new()` returning nullptr, and throw on `ZenServerState::Register()` returning nullptr instead of dereferencing - Fail on unrecognized zenserver `--mode` instead of silently defaulting to store ### Other - Show host details (hostname, platform, CPU count, memory) when discovering new compute workers - Move frontend `html.zip` from source tree into build directory - Add format specifications for Compact Binary and Compressed Buffer wire formats - Add `WriteCompactBinaryObject` to zencore - Extended `ConsoleTui` with additional functionality - Add `--vscode` option to `xmake sln` for clangd / `compile_commands.json` support - Disable compute/horde/nomad in release builds (not yet production-ready) - Disable unintended `ASIO_HAS_IO_URING` enablement - Fix crashpad patch missing leading whitespace - Clean up code triggering gcc false positives
* Enable cross compilation of Windows targets on Linux (#839)Stefan Boberg2026-03-161-2/+2
| | | | | | | This PR makes it *possible* to do a Windows build on Linux via `clang-cl`. It doesn't actually change any build process. No policy change, just mechanics and some code fixes to clear clang compilation. The code fixes are mainly related to #include file name casing, to match the on-disk casing of the SDK files (via xwin).
* ZenServerProcess API changes (#719)Stefan Boberg2026-01-191-0/+1
| | | | | | | This refactor aims to improve the `ZenServerProcess` classes by making them useful for managing child zenserver instances in more scenarios than just automated tests. This involves changing some functions to not talk about "test directory" and instead use "data directory" etc As a consequence of the API changes, some tests have changed accordingly. The code includes som reference to the "hub" mode but there is not yet any other code using this mode, it's just included in this PR to simplify future merges.
* Rename IsElevated to RequiresElevationLiam Mitchell2026-01-151-9/+9
|
* Implement final changes required for daemon mode on MacLiam Mitchell2026-01-071-1/+5
|
* Make files writeable after full service install to avoid issues when ↵Liam Mitchell2025-11-171-0/+4
| | | | attempting to update from a read-only source such as p4
* Set ownership of service executables to the service user on Linux (#489)Liam Mitchell2025-09-081-0/+44
| | | - Bugfix: Linux only, set ownership of installed files to specified user when using `zen service install --full --user`
* refactor zen command return value handling (#487)Dan Engelbrecht2025-09-051-80/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Improvement: Use consistent language for command line argument parsing errors - Improvement: Changed zen command parsing errors to output help first and error last to make it easier to spot the error - Improvement: Refactor zen command return codes to conform to valid Linux range (0-255) kSuccess = 0, kOtherError = 1, kBadInput = 2, kOutOfMemory = 16, kOutOfDisk = 17, kAssertError = 70, kHttpOtherClientError = 80, kHttpCantConnectError = 81, kHttpNotFound = 66, // NotFound(404) kHttpUnauthorized = 77, // Unauthorized(401), kHttpSLLError = 82, kHttpForbidden = 83, // Forbidden(403) kHttpTimeout = 84, // RequestTimeout(408) kHttpConflict = 85, // Conflict(409) kHttpNoHost = 86, kHttpOtherServerError = 90, kHttpInternalServerError = 91, // InternalServerError(500) kHttpServiceUnavailable = 69, // ServiceUnavailable(503) kHttpBadGateway = 92, // BadGateway(502) kHttpGatewayTimeout = 93, // GatewayTimeout(504)
* Avoid mutating executable paths when copying files during full service ↵Liam Mitchell2025-09-041-5/+7
| | | | install (#486)
* Fix trailing whitespace in service_cmd.cppLiam Mitchell2025-08-201-1/+0
|
* Fix permissions and ownership issues with service binary copy and remove ↵Liam Mitchell2025-07-251-1/+10
| | | | unnecessary alias from unit file
* Increase service stop timeout to 30 seconds during full installLiam Mitchell2025-07-211-1/+1
|
* Add PDBs and crashpad_handler to installed files during full service installLiam Mitchell2025-07-211-11/+24
|
* Add --full option to service install, which will handle stop/uninstall if ↵Liam Mitchell2025-07-161-9/+119
| | | | necessary, and copy binaries to install location
* Merge pull request #321 from ue-foundation/lm/zen-service-elevated-command-lineLiam Mitchell2025-03-261-2/+2
|\ | | | | Fix command line parsing when running service commands elevated
| * Fix command line parsing when running service commands elevatedLiam Mitchell2025-03-251-2/+2
| |
* | Update return codes for service commands to provide more information to the ↵Liam Mitchell2025-03-251-2/+16
|/ | | | caller
* Merge remote-tracking branch 'origin/main' into de/zen-service-commandDan Engelbrecht2025-03-141-6/+1
|
* Implementation of service commands for Linux.Liam Mitchell2025-02-271-1/+8
|
* fix positional arguments for zen service install on non-windows platformsDan Engelbrecht2025-01-171-1/+3
|
* systemd unit file, incompleteDan Engelbrecht2025-01-151-1/+1
|
* typo fixDan Engelbrecht2025-01-101-1/+1
|
* clang formatDan Engelbrecht2025-01-101-26/+28
|
* displayname and description are windows-only propertiesDan Engelbrecht2025-01-101-28/+34
|
* partially working service commands for macosDan Engelbrecht2025-01-101-1/+2
|
* make windows elevation optionalDan Engelbrecht2025-01-101-70/+130
|
* remove ServiceLevelDan Engelbrecht2025-01-101-29/+8
|
* use attachconsole to send ctrl+c to running processDan Engelbrecht2025-01-081-2/+7
|
* add ServiceLevel for service processes: User, AllUsers and ServiceDan Engelbrecht2025-01-081-26/+103
|
* check if service is already installed before attempting installDan Engelbrecht2025-01-081-7/+27
|
* Add ServiceSpec structDan Engelbrecht2025-01-081-12/+14
|
* zen `service` commandDan Engelbrecht2025-01-081-0/+308