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/runners | |
| 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/runners')
| -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 |
9 files changed, 33 insertions, 33 deletions
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) |