diff options
| author | Dan Engelbrecht <[email protected]> | 2026-04-13 19:17:09 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-13 19:17:09 +0200 |
| commit | 3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7 (patch) | |
| tree | 8d24babc8cd3d097800af0bd960c7ba1d72927d7 /src/zencompute | |
| parent | use mimalloc by default (#952) (diff) | |
| download | zen-3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7.tar.xz zen-3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7.zip | |
fix utf characters in source code (#953)
Diffstat (limited to 'src/zencompute')
| -rw-r--r-- | src/zencompute/cloudmetadata.cpp | 8 | ||||
| -rw-r--r-- | src/zencompute/computeservice.cpp | 24 | ||||
| -rw-r--r-- | src/zencompute/httpcomputeservice.cpp | 22 | ||||
| -rw-r--r-- | src/zencompute/httporchestrator.cpp | 4 | ||||
| -rw-r--r-- | src/zencompute/include/zencompute/cloudmetadata.h | 2 | ||||
| -rw-r--r-- | src/zencompute/include/zencompute/httporchestrator.h | 4 | ||||
| -rw-r--r-- | src/zencompute/include/zencompute/mockimds.h | 2 | ||||
| -rw-r--r-- | src/zencompute/orchestratorservice.cpp | 6 | ||||
| -rw-r--r-- | src/zencompute/pathvalidation.h | 2 | ||||
| -rw-r--r-- | src/zencompute/runners/functionrunner.cpp | 6 | ||||
| -rw-r--r-- | src/zencompute/runners/functionrunner.h | 2 | ||||
| -rw-r--r-- | src/zencompute/runners/linuxrunner.cpp | 16 | ||||
| -rw-r--r-- | src/zencompute/runners/localrunner.cpp | 4 | ||||
| -rw-r--r-- | src/zencompute/runners/macrunner.cpp | 12 | ||||
| -rw-r--r-- | src/zencompute/runners/remotehttprunner.cpp | 18 | ||||
| -rw-r--r-- | src/zencompute/runners/remotehttprunner.h | 2 | ||||
| -rw-r--r-- | src/zencompute/runners/windowsrunner.cpp | 4 | ||||
| -rw-r--r-- | src/zencompute/runners/winerunner.cpp | 2 |
18 files changed, 70 insertions, 70 deletions
diff --git a/src/zencompute/cloudmetadata.cpp b/src/zencompute/cloudmetadata.cpp index eb4c05f9f..f1df18e8e 100644 --- a/src/zencompute/cloudmetadata.cpp +++ b/src/zencompute/cloudmetadata.cpp @@ -183,7 +183,7 @@ CloudMetadata::TryDetectAWS() m_Info.AvailabilityZone = std::string(AzResponse.AsText()); } - // "spot" vs "on-demand" — determines whether the instance can be + // "spot" vs "on-demand" - determines whether the instance can be // reclaimed by AWS with a 2-minute warning HttpClient::Response LifecycleResponse = ImdsClient.Get("/latest/meta-data/instance-life-cycle", AuthHeaders); if (LifecycleResponse.IsSuccess()) @@ -273,7 +273,7 @@ CloudMetadata::TryDetectAzure() std::string Priority = Compute["priority"].string_value(); m_Info.IsSpot = (Priority == "Spot"); - // Check if part of a VMSS (Virtual Machine Scale Set) — indicates autoscaling + // Check if part of a VMSS (Virtual Machine Scale Set) - indicates autoscaling std::string VmssName = Compute["vmScaleSetName"].string_value(); m_Info.IsAutoscaling = !VmssName.empty(); @@ -609,7 +609,7 @@ namespace zen::compute { TEST_SUITE_BEGIN("compute.cloudmetadata"); // --------------------------------------------------------------------------- -// Test helper — spins up a local ASIO HTTP server hosting a MockImdsService +// Test helper - spins up a local ASIO HTTP server hosting a MockImdsService // --------------------------------------------------------------------------- struct TestImdsServer @@ -974,7 +974,7 @@ TEST_CASE("cloudmetadata.sentinel_files") SUBCASE("only failed providers get sentinels") { - // Switch to AWS — Azure and GCP never probed, so no sentinels for them + // Switch to AWS - Azure and GCP never probed, so no sentinels for them Imds.Mock.ActiveProvider = CloudProvider::AWS; auto Cloud = Imds.CreateCloud(); diff --git a/src/zencompute/computeservice.cpp b/src/zencompute/computeservice.cpp index 852e93fa0..7f354a51c 100644 --- a/src/zencompute/computeservice.cpp +++ b/src/zencompute/computeservice.cpp @@ -449,7 +449,7 @@ ComputeServiceSession::Impl::RequestStateTransition(SessionState NewState) return true; } - // CAS failed, Current was updated — retry with the new value + // CAS failed, Current was updated - retry with the new value } } @@ -1612,7 +1612,7 @@ ComputeServiceSession::Impl::SchedulePendingActions() // Also note that the m_PendingActions list is not maintained // here, that's done periodically in SchedulePendingActions() - // Extract pending actions under a shared lock — we only need to read + // Extract pending actions under a shared lock - we only need to read // the map and take Ref copies. ActionState() is atomic so this is safe. // Sorting and capacity trimming happen outside the lock to avoid // blocking HTTP handlers on O(N log N) work with large pending queues. @@ -1741,7 +1741,7 @@ ComputeServiceSession::Impl::SchedulerThreadFunction() HandleActionUpdates(); - // Auto-transition Draining → Paused when all work is done + // Auto-transition Draining -> Paused when all work is done if (m_SessionState.load(std::memory_order_relaxed) == SessionState::Draining) { bool AllDrained = m_ActionMapLock.WithSharedLock([&] { return m_PendingActions.empty() && m_RunningMap.empty(); }); @@ -1866,7 +1866,7 @@ ComputeServiceSession::Impl::RescheduleAction(int ActionLsn) } } - // Reset action state — this calls PostUpdate() internally + // Reset action state - this calls PostUpdate() internally Action->ResetActionStateToPending(); int NewRetryCount = Action->RetryCount.load(std::memory_order_relaxed); @@ -1948,7 +1948,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() // This is safe because state transitions are monotonically increasing by enum // rank (Pending < Submitting < Running < Completed/Failed/Cancelled), so // SetActionState rejects any transition to a lower-ranked state. By the time - // we read ActionState() here, it reflects the highest state reached — making + // we read ActionState() here, it reflects the highest state reached - making // the first occurrence per LSN authoritative and duplicates redundant. for (Ref<RunnerAction>& Action : UpdatedActions) { @@ -1958,7 +1958,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() { switch (Action->ActionState()) { - // Newly enqueued — add to pending map for scheduling + // Newly enqueued - add to pending map for scheduling case RunnerAction::State::Pending: // Guard against a race where the session is abandoned between // EnqueueAction (which calls PostUpdate) and this scheduler @@ -1979,11 +1979,11 @@ ComputeServiceSession::Impl::HandleActionUpdates() } break; - // Async submission in progress — remains in pending map + // Async submission in progress - remains in pending map case RunnerAction::State::Submitting: break; - // Dispatched to a runner — move from pending to running + // Dispatched to a runner - move from pending to running case RunnerAction::State::Running: m_ActionMapLock.WithExclusiveLock([&] { m_RunningMap.insert({ActionLsn, Action}); @@ -1992,7 +1992,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() ZEN_DEBUG("action {} ({}) RUNNING", Action->ActionId, ActionLsn); break; - // Retracted — pull back for rescheduling without counting against retry limit + // Retracted - pull back for rescheduling without counting against retry limit case RunnerAction::State::Retracted: { m_ActionMapLock.WithExclusiveLock([&] { @@ -2004,7 +2004,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() break; } - // Rejected — runner was at capacity, reschedule without retry cost + // Rejected - runner was at capacity, reschedule without retry cost case RunnerAction::State::Rejected: { Action->ResetActionStateToPending(); @@ -2012,7 +2012,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() break; } - // Terminal states — move to results, record history, notify queue + // Terminal states - move to results, record history, notify queue case RunnerAction::State::Completed: case RunnerAction::State::Failed: case RunnerAction::State::Abandoned: @@ -2021,7 +2021,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() auto TerminalState = Action->ActionState(); // Automatic retry for Failed/Abandoned actions with retries remaining. - // Skip retries when the session itself is abandoned — those actions + // Skip retries when the session itself is abandoned - those actions // were intentionally abandoned and should not be rescheduled. if ((TerminalState == RunnerAction::State::Failed || TerminalState == RunnerAction::State::Abandoned) && m_SessionState.load(std::memory_order_relaxed) < SessionState::Abandoned) diff --git a/src/zencompute/httpcomputeservice.cpp b/src/zencompute/httpcomputeservice.cpp index 8cbb25afd..5ab189d89 100644 --- a/src/zencompute/httpcomputeservice.cpp +++ b/src/zencompute/httpcomputeservice.cpp @@ -78,13 +78,13 @@ struct HttpComputeService::Impl std::string ClientHostname; // empty if no hostname was provided }; - // Remote queue registry — all three maps share the same RemoteQueueInfo objects. + // Remote queue registry - all three maps share the same RemoteQueueInfo objects. // All maps are guarded by m_RemoteQueueLock. RwLock m_RemoteQueueLock; - std::unordered_map<Oid, Ref<RemoteQueueInfo>, Oid::Hasher> m_RemoteQueuesByToken; // Token → info - std::unordered_map<int, Ref<RemoteQueueInfo>> m_RemoteQueuesByQueueId; // QueueId → info - std::unordered_map<std::string, Ref<RemoteQueueInfo>> m_RemoteQueuesByTag; // idempotency key → info + std::unordered_map<Oid, Ref<RemoteQueueInfo>, Oid::Hasher> m_RemoteQueuesByToken; // Token -> info + std::unordered_map<int, Ref<RemoteQueueInfo>> m_RemoteQueuesByQueueId; // QueueId -> info + std::unordered_map<std::string, Ref<RemoteQueueInfo>> m_RemoteQueuesByTag; // idempotency key -> info LoggerRef Log() { return m_Log; } @@ -672,7 +672,7 @@ HttpComputeService::Impl::RegisterRoutes() }, HttpVerb::kGet | HttpVerb::kPost); - // Queue creation routes — these remain separate since local creates a plain queue + // Queue creation routes - these remain separate since local creates a plain queue // while remote additionally generates an OID token for external access. m_Router.RegisterRoute( @@ -726,7 +726,7 @@ HttpComputeService::Impl::RegisterRoutes() return HttpReq.WriteResponse(HttpResponseCode::OK, Cbo.Save()); } - // Queue has since expired — clean up stale entries and fall through to create a new one + // Queue has since expired - clean up stale entries and fall through to create a new one m_RemoteQueuesByToken.erase(Existing->Token); m_RemoteQueuesByQueueId.erase(Existing->QueueId); m_RemoteQueuesByTag.erase(It); @@ -755,7 +755,7 @@ HttpComputeService::Impl::RegisterRoutes() }, HttpVerb::kPost); - // Unified queue routes — {queueref} accepts both local integer IDs and remote OID tokens. + // Unified queue routes - {queueref} accepts both local integer IDs and remote OID tokens. // ResolveQueueRef() handles access control (local-only for integer IDs) and token resolution. m_Router.RegisterRoute( @@ -1105,7 +1105,7 @@ HttpComputeService::Impl::RegisterRoutes() }, HttpVerb::kPost); - // WebSocket upgrade endpoint — the handler logic lives in + // WebSocket upgrade endpoint - the handler logic lives in // HttpComputeService::OnWebSocket* methods; this route merely // satisfies the router so the upgrade request isn't rejected. m_Router.RegisterRoute( @@ -1241,7 +1241,7 @@ HttpComputeService::Impl::ResolveQueueRef(HttpServerRequest& HttpReq, std::strin { if (OidMatcher(Capture)) { - // Remote OID token — accessible from any client + // Remote OID token - accessible from any client const Oid Token = Oid::FromHexString(Capture); const int QueueId = ResolveQueueToken(Token); @@ -1253,7 +1253,7 @@ HttpComputeService::Impl::ResolveQueueRef(HttpServerRequest& HttpReq, std::strin return QueueId; } - // Local integer queue ID — restricted to local machine requests + // Local integer queue ID - restricted to local machine requests if (!HttpReq.IsLocalMachineRequest()) { HttpReq.WriteResponse(HttpResponseCode::Forbidden); @@ -1709,7 +1709,7 @@ HttpComputeService::OnActionsCompleted(std::span<const CompletedActionNotificati ////////////////////////////////////////////////////////////////////////// // -// Impl — WebSocket / observer +// Impl - WebSocket / observer // void diff --git a/src/zencompute/httporchestrator.cpp b/src/zencompute/httporchestrator.cpp index 1f51e560e..56eadcd57 100644 --- a/src/zencompute/httporchestrator.cpp +++ b/src/zencompute/httporchestrator.cpp @@ -478,7 +478,7 @@ HttpOrchestratorService::Shutdown() m_PushThread.join(); } - // Clean up worker WebSocket connections — collect IDs under lock, then + // Clean up worker WebSocket connections - collect IDs under lock, then // notify the service outside the lock to avoid lock-order inversions. std::vector<std::string> WorkerIds; m_WorkerWsLock.WithExclusiveLock([&] { @@ -582,7 +582,7 @@ std::string HttpOrchestratorService::HandleWorkerWebSocketMessage(const WebSocketMessage& Msg) { // Workers send CbObject in native binary format over the WebSocket to - // avoid the lossy CbObject↔JSON round-trip. + // avoid the lossy CbObject<->JSON round-trip. CbObject Data = CbObject::MakeView(Msg.Payload.GetData()); if (!Data) { diff --git a/src/zencompute/include/zencompute/cloudmetadata.h b/src/zencompute/include/zencompute/cloudmetadata.h index 3b9642ac3..280d794e7 100644 --- a/src/zencompute/include/zencompute/cloudmetadata.h +++ b/src/zencompute/include/zencompute/cloudmetadata.h @@ -64,7 +64,7 @@ public: explicit CloudMetadata(std::filesystem::path DataDir); /** Synchronously probes cloud providers at the given IMDS endpoint. - * Intended for testing — allows redirecting all IMDS queries to a local + * Intended for testing - allows redirecting all IMDS queries to a local * mock HTTP server instead of the real 169.254.169.254 endpoint. */ CloudMetadata(std::filesystem::path DataDir, std::string ImdsEndpoint); diff --git a/src/zencompute/include/zencompute/httporchestrator.h b/src/zencompute/include/zencompute/httporchestrator.h index ef0a1269a..4e4f5f0f8 100644 --- a/src/zencompute/include/zencompute/httporchestrator.h +++ b/src/zencompute/include/zencompute/httporchestrator.h @@ -108,9 +108,9 @@ private: Event m_PushEvent; void PushThreadFunction(); - // Worker WebSocket connections (worker→orchestrator persistent links) + // Worker WebSocket connections (worker->orchestrator persistent links) RwLock m_WorkerWsLock; - std::unordered_map<WebSocketConnection*, std::string> m_WorkerWsMap; // connection ptr → worker ID + std::unordered_map<WebSocketConnection*, std::string> m_WorkerWsMap; // connection ptr -> worker ID std::string HandleWorkerWebSocketMessage(const WebSocketMessage& Msg); #endif }; diff --git a/src/zencompute/include/zencompute/mockimds.h b/src/zencompute/include/zencompute/mockimds.h index 704306913..6074240b9 100644 --- a/src/zencompute/include/zencompute/mockimds.h +++ b/src/zencompute/include/zencompute/mockimds.h @@ -1,5 +1,5 @@ // Copyright Epic Games, Inc. All Rights Reserved. -// Moved to zenutil — this header is kept for backward compatibility. +// Moved to zenutil - this header is kept for backward compatibility. #pragma once diff --git a/src/zencompute/orchestratorservice.cpp b/src/zencompute/orchestratorservice.cpp index aee8fa63a..68199ab3c 100644 --- a/src/zencompute/orchestratorservice.cpp +++ b/src/zencompute/orchestratorservice.cpp @@ -180,11 +180,11 @@ OrchestratorService::SetWorkerWebSocketConnected(std::string_view WorkerId, bool if (Connected) { - ZEN_INFO("worker {} WebSocket connected — marking reachable", WorkerId); + ZEN_INFO("worker {} WebSocket connected - marking reachable", WorkerId); } else { - ZEN_WARN("worker {} WebSocket disconnected — marking unreachable", WorkerId); + ZEN_WARN("worker {} WebSocket disconnected - marking unreachable", WorkerId); } }); @@ -617,7 +617,7 @@ OrchestratorService::ProbeThreadFunction() continue; } - // Check if the provisioner knows this worker is draining — if so, + // Check if the provisioner knows this worker is draining - if so, // unreachability is expected and should not be logged as a warning. bool IsDraining = false; if (IProvisionerStateProvider* Prov = m_Provisioner.load(std::memory_order_acquire)) diff --git a/src/zencompute/pathvalidation.h b/src/zencompute/pathvalidation.h index c2e30183a..d50ad4a2a 100644 --- a/src/zencompute/pathvalidation.h +++ b/src/zencompute/pathvalidation.h @@ -78,7 +78,7 @@ ValidateSandboxRelativePath(std::string_view Name) throw zen::invalid_argument("path traversal detected: '{}' contains '..' component", Name); } - // Skip "." (current directory) — harmless in relative paths + // Skip "." (current directory) - harmless in relative paths if (ComponentStr != ".") { ValidatePathComponent(ComponentStr, Name); diff --git a/src/zencompute/runners/functionrunner.cpp b/src/zencompute/runners/functionrunner.cpp index ab22c6363..34bf065b4 100644 --- a/src/zencompute/runners/functionrunner.cpp +++ b/src/zencompute/runners/functionrunner.cpp @@ -126,7 +126,7 @@ BaseRunnerGroup::SubmitActions(const std::vector<Ref<RunnerAction>>& Actions) ZEN_TRACE_CPU("BaseRunnerGroup::SubmitActions"); // Snapshot runners and query capacity under the lock, then release - // before submitting — HTTP submissions to remote runners can take + // before submitting - HTTP submissions to remote runners can take // hundreds of milliseconds and we must not hold m_RunnersLock during I/O. std::vector<Ref<FunctionRunner>> Runners; @@ -192,7 +192,7 @@ BaseRunnerGroup::SubmitActions(const std::vector<Ref<RunnerAction>>& Actions) } } - // Submit batches per runner — in parallel when a worker pool is available + // Submit batches per runner - in parallel when a worker pool is available std::vector<std::vector<SubmitResult>> PerRunnerResults(RunnerCount); @@ -414,7 +414,7 @@ RunnerAction::ResetActionStateToPending() CpuUsagePercent.store(-1.0f, std::memory_order_relaxed); CpuSeconds.store(0.0f, std::memory_order_relaxed); - // Increment retry count (skip for Retracted/Rejected — nothing failed) + // Increment retry count (skip for Retracted/Rejected - nothing failed) if (CurrentState != State::Retracted && CurrentState != State::Rejected) { RetryCount.fetch_add(1, std::memory_order_relaxed); diff --git a/src/zencompute/runners/functionrunner.h b/src/zencompute/runners/functionrunner.h index 449f0e228..371a60b7a 100644 --- a/src/zencompute/runners/functionrunner.h +++ b/src/zencompute/runners/functionrunner.h @@ -192,7 +192,7 @@ struct RunnerAction : public RefCounted Completed, // Finished successfully with results available Failed, // Execution failed (transient error, eligible for retry) Abandoned, // Infrastructure termination (e.g. spot eviction, session abandon) - Rejected, // Runner declined (e.g. at capacity) — rescheduled without retry cost + Rejected, // Runner declined (e.g. at capacity) - rescheduled without retry cost Cancelled, // Intentional user cancellation (never retried) Retracted, // Pulled back for rescheduling on a different runner (no retry cost) _Count diff --git a/src/zencompute/runners/linuxrunner.cpp b/src/zencompute/runners/linuxrunner.cpp index ce5bbdcc8..be4274823 100644 --- a/src/zencompute/runners/linuxrunner.cpp +++ b/src/zencompute/runners/linuxrunner.cpp @@ -195,7 +195,7 @@ namespace { WriteErrorAndExit(ErrorPipeFd, "bind mount /lib failed", errno); } - // /lib64 (optional — not all distros have it) + // /lib64 (optional - not all distros have it) { struct stat St; if (stat("/lib64", &St) == 0 && S_ISDIR(St.st_mode)) @@ -208,7 +208,7 @@ namespace { } } - // /etc (required — for resolv.conf, ld.so.cache, etc.) + // /etc (required - for resolv.conf, ld.so.cache, etc.) if (MkdirIfNeeded(BuildPath("etc"), 0755) != 0) { WriteErrorAndExit(ErrorPipeFd, "mkdir sandbox/etc failed", errno); @@ -218,7 +218,7 @@ namespace { WriteErrorAndExit(ErrorPipeFd, "bind mount /etc failed", errno); } - // /worker — bind-mount worker directory (contains the executable) + // /worker - bind-mount worker directory (contains the executable) if (MkdirIfNeeded(BuildPath("worker"), 0755) != 0) { WriteErrorAndExit(ErrorPipeFd, "mkdir sandbox/worker failed", errno); @@ -430,12 +430,12 @@ LinuxProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (ChildPid == 0) { - // Child process — lower priority so workers don't starve the main server + // Child process - lower priority so workers don't starve the main server nice(5); if (m_Sandboxed) { - // Close read end of error pipe — child only writes + // Close read end of error pipe - child only writes close(ErrorPipe[0]); SetupNamespaceSandbox(SandboxPathStr.c_str(), CurrentUid, CurrentGid, WorkerPathStr.c_str(), ErrorPipe[1]); @@ -462,7 +462,7 @@ LinuxProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (m_Sandboxed) { - // Close write end of error pipe — parent only reads + // Close write end of error pipe - parent only reads close(ErrorPipe[1]); // Read from error pipe. If execve succeeded, pipe was closed by O_CLOEXEC @@ -679,7 +679,7 @@ ReadProcStatCpuTicks(pid_t Pid) Buf[Len] = '\0'; - // Skip past "pid (name) " — find last ')' to handle names containing spaces or parens + // Skip past "pid (name) " - find last ')' to handle names containing spaces or parens const char* P = strrchr(Buf, ')'); if (!P) { @@ -709,7 +709,7 @@ LinuxProcessRunner::SampleProcessCpu(RunningAction& Running) if (CurrentOsTicks == 0) { - // Process gone or /proc entry unreadable — record timestamp without updating usage + // Process gone or /proc entry unreadable - record timestamp without updating usage Running.LastCpuSampleTicks = NowTicks; Running.LastCpuOsTicks = 0; return; diff --git a/src/zencompute/runners/localrunner.cpp b/src/zencompute/runners/localrunner.cpp index 96cbdc134..259965e23 100644 --- a/src/zencompute/runners/localrunner.cpp +++ b/src/zencompute/runners/localrunner.cpp @@ -337,7 +337,7 @@ LocalProcessRunner::PrepareActionSubmission(Ref<RunnerAction> Action) SubmitResult LocalProcessRunner::SubmitAction(Ref<RunnerAction> Action) { - // Base class is not directly usable — platform subclasses override this + // Base class is not directly usable - platform subclasses override this ZEN_UNUSED(Action); return SubmitResult{.IsAccepted = false}; } @@ -620,7 +620,7 @@ LocalProcessRunner::MonitorThreadFunction() void LocalProcessRunner::CancelRunningActions() { - // Base class is not directly usable — platform subclasses override this + // Base class is not directly usable - platform subclasses override this } void diff --git a/src/zencompute/runners/macrunner.cpp b/src/zencompute/runners/macrunner.cpp index 13c01d988..ab24d4672 100644 --- a/src/zencompute/runners/macrunner.cpp +++ b/src/zencompute/runners/macrunner.cpp @@ -211,19 +211,19 @@ MacProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (ChildPid == 0) { - // Child process — lower priority so workers don't starve the main server + // Child process - lower priority so workers don't starve the main server nice(5); if (m_Sandboxed) { - // Close read end of error pipe — child only writes + // Close read end of error pipe - child only writes close(ErrorPipe[0]); // Apply Seatbelt sandbox profile char* ErrorBuf = nullptr; if (sandbox_init(SandboxProfile.c_str(), 0, &ErrorBuf) != 0) { - // sandbox_init failed — write error to pipe and exit + // sandbox_init failed - write error to pipe and exit if (ErrorBuf) { WriteErrorAndExit(ErrorPipe[1], ErrorBuf, 0); @@ -262,7 +262,7 @@ MacProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (m_Sandboxed) { - // Close write end of error pipe — parent only reads + // Close write end of error pipe - parent only reads close(ErrorPipe[1]); // Read from error pipe. If execve succeeded, pipe was closed by O_CLOEXEC @@ -471,7 +471,7 @@ MacProcessRunner::SampleProcessCpu(RunningAction& Running) const uint64_t CurrentOsTicks = Info.pti_total_user + Info.pti_total_system; const uint64_t NowTicks = GetHifreqTimerValue(); - // Cumulative CPU seconds (absolute, available from first sample): ns → seconds + // Cumulative CPU seconds (absolute, available from first sample): ns -> seconds Running.Action->CpuSeconds.store(static_cast<float>(static_cast<double>(CurrentOsTicks) / 1'000'000'000.0), std::memory_order_relaxed); if (Running.LastCpuSampleTicks != 0 && Running.LastCpuOsTicks != 0) @@ -480,7 +480,7 @@ MacProcessRunner::SampleProcessCpu(RunningAction& Running) if (ElapsedMs > 0) { const uint64_t DeltaOsTicks = CurrentOsTicks - Running.LastCpuOsTicks; - // ns → ms: divide by 1,000,000; then as percent of elapsed ms + // ns -> ms: divide by 1,000,000; then as percent of elapsed ms const float CpuPct = static_cast<float>(static_cast<double>(DeltaOsTicks) / 1'000'000.0 / ElapsedMs * 100.0); Running.Action->CpuUsagePercent.store(CpuPct, std::memory_order_relaxed); } diff --git a/src/zencompute/runners/remotehttprunner.cpp b/src/zencompute/runners/remotehttprunner.cpp index 55f78fdd6..08f381b7f 100644 --- a/src/zencompute/runners/remotehttprunner.cpp +++ b/src/zencompute/runners/remotehttprunner.cpp @@ -263,7 +263,7 @@ RemoteHttpRunner::SubmitActions(const std::vector<Ref<RunnerAction>>& Actions) // Collect distinct QueueIds and ensure remote queues exist once per queue - std::unordered_map<int, Oid> QueueTokens; // QueueId → remote token (0 stays as Zero) + std::unordered_map<int, Oid> QueueTokens; // QueueId -> remote token (0 stays as Zero) for (const Ref<RunnerAction>& Action : Actions) { @@ -416,7 +416,7 @@ RemoteHttpRunner::SubmitAction(Ref<RunnerAction> Action) if (WorkResponseCode == HttpResponseCode::FailedDependency && Attempt == 0) { - ZEN_WARN("remote {} returned FailedDependency for action {} — re-registering worker and retrying", + ZEN_WARN("remote {} returned FailedDependency for action {} - re-registering worker and retrying", m_Http.GetBaseUri(), ActionId); @@ -437,7 +437,7 @@ RemoteHttpRunner::SubmitAction(Ref<RunnerAction> Action) if (WorkResponseCode == HttpResponseCode::FailedDependency && Attempt == 0) { - ZEN_WARN("remote {} returned FailedDependency for action {} — re-registering worker and retrying", + ZEN_WARN("remote {} returned FailedDependency for action {} - re-registering worker and retrying", m_Http.GetBaseUri(), ActionId); @@ -451,7 +451,7 @@ RemoteHttpRunner::SubmitAction(Ref<RunnerAction> Action) if (WorkResponseCode == HttpResponseCode::NotFound) { - // Remote needs attachments — resolve them and retry with a CbPackage + // Remote needs attachments - resolve them and retry with a CbPackage CbPackage Pkg; Pkg.SetObject(ActionObj); @@ -644,7 +644,7 @@ RemoteHttpRunner::SubmitActionBatch(const std::string& SubmitUrl, const std::vec } else { - ZEN_WARN("batch submit: missing attachment {} — falling back to individual submit", NeedHash); + ZEN_WARN("batch submit: missing attachment {} - falling back to individual submit", NeedHash); return FallbackToIndividualSubmit(Actions); } } @@ -656,16 +656,16 @@ RemoteHttpRunner::SubmitActionBatch(const std::string& SubmitUrl, const std::vec return ParseBatchResponse(RetryResponse, Actions); } - ZEN_WARN("batch submit retry failed with {} {} — falling back to individual submit", + ZEN_WARN("batch submit retry failed with {} {} - falling back to individual submit", (int)RetryResponse.StatusCode, ToString(RetryResponse.StatusCode)); return FallbackToIndividualSubmit(Actions); } } - // Unexpected status or connection error — fall back to individual submission + // Unexpected status or connection error - fall back to individual submission - ZEN_WARN("batch submit to {}{} failed — falling back to individual submit", m_Http.GetBaseUri(), SubmitUrl); + ZEN_WARN("batch submit to {}{} failed - falling back to individual submit", m_Http.GetBaseUri(), SubmitUrl); return FallbackToIndividualSubmit(Actions); } @@ -927,7 +927,7 @@ RemoteHttpRunner::MonitorThreadFunction() SweepOnce(); } - // Signal received — may be a WS wakeup or a quit signal + // Signal received - may be a WS wakeup or a quit signal SweepOnce(); } while (m_MonitorThreadEnabled); diff --git a/src/zencompute/runners/remotehttprunner.h b/src/zencompute/runners/remotehttprunner.h index fdf113c77..521bf2f82 100644 --- a/src/zencompute/runners/remotehttprunner.h +++ b/src/zencompute/runners/remotehttprunner.h @@ -96,7 +96,7 @@ private: size_t SweepRunningActions(); RwLock m_QueueTokenLock; - std::unordered_map<int, Oid> m_RemoteQueueTokens; // local QueueId → remote queue token + std::unordered_map<int, Oid> m_RemoteQueueTokens; // local QueueId -> remote queue token // Stable identity for this runner instance, used as part of the idempotency key when // creating remote queues. Generated once at construction and never changes. diff --git a/src/zencompute/runners/windowsrunner.cpp b/src/zencompute/runners/windowsrunner.cpp index e643c9ce8..c6b3e82ea 100644 --- a/src/zencompute/runners/windowsrunner.cpp +++ b/src/zencompute/runners/windowsrunner.cpp @@ -485,7 +485,7 @@ WindowsProcessRunner::SampleProcessCpu(RunningAction& Running) const uint64_t CurrentOsTicks = FtToU64(KernelTime) + FtToU64(UserTime); const uint64_t NowTicks = GetHifreqTimerValue(); - // Cumulative CPU seconds (absolute, available from first sample): 100ns → seconds + // Cumulative CPU seconds (absolute, available from first sample): 100ns -> seconds Running.Action->CpuSeconds.store(static_cast<float>(static_cast<double>(CurrentOsTicks) / 10'000'000.0), std::memory_order_relaxed); if (Running.LastCpuSampleTicks != 0 && Running.LastCpuOsTicks != 0) @@ -494,7 +494,7 @@ WindowsProcessRunner::SampleProcessCpu(RunningAction& Running) if (ElapsedMs > 0) { const uint64_t DeltaOsTicks = CurrentOsTicks - Running.LastCpuOsTicks; - // 100ns → ms: divide by 10000; then as percent of elapsed ms + // 100ns -> ms: divide by 10000; then as percent of elapsed ms const float CpuPct = static_cast<float>(static_cast<double>(DeltaOsTicks) / 10000.0 / ElapsedMs * 100.0); Running.Action->CpuUsagePercent.store(CpuPct, std::memory_order_relaxed); } diff --git a/src/zencompute/runners/winerunner.cpp b/src/zencompute/runners/winerunner.cpp index 593b19e55..29ab93663 100644 --- a/src/zencompute/runners/winerunner.cpp +++ b/src/zencompute/runners/winerunner.cpp @@ -96,7 +96,7 @@ WineProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (ChildPid == 0) { - // Child process — lower priority so workers don't starve the main server + // Child process - lower priority so workers don't starve the main server nice(5); if (chdir(SandboxPathStr.c_str()) != 0) |