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/zenutil | |
| 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/zenutil')
| -rw-r--r-- | src/zenutil/cloud/imdscredentials.cpp | 4 | ||||
| -rw-r--r-- | src/zenutil/cloud/minioprocess.cpp | 2 | ||||
| -rw-r--r-- | src/zenutil/cloud/mockimds.cpp | 6 | ||||
| -rw-r--r-- | src/zenutil/cloud/s3client.cpp | 2 | ||||
| -rw-r--r-- | src/zenutil/consoletui.cpp | 4 | ||||
| -rw-r--r-- | src/zenutil/consul/consul.cpp | 2 | ||||
| -rw-r--r-- | src/zenutil/include/zenutil/cloud/mockimds.h | 14 | ||||
| -rw-r--r-- | src/zenutil/include/zenutil/consoletui.h | 2 | ||||
| -rw-r--r-- | src/zenutil/include/zenutil/process/subprocessmanager.h | 6 | ||||
| -rw-r--r-- | src/zenutil/include/zenutil/sessionsclient.h | 6 | ||||
| -rw-r--r-- | src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h | 8 | ||||
| -rw-r--r-- | src/zenutil/logging/logging.cpp | 2 | ||||
| -rw-r--r-- | src/zenutil/logging/rotatingfilesink.cpp | 2 | ||||
| -rw-r--r-- | src/zenutil/process/asyncpipereader.cpp | 6 | ||||
| -rw-r--r-- | src/zenutil/process/subprocessmanager.cpp | 16 | ||||
| -rw-r--r-- | src/zenutil/sessionsclient.cpp | 6 | ||||
| -rw-r--r-- | src/zenutil/splitconsole/logstreamlistener.cpp | 12 |
17 files changed, 50 insertions, 50 deletions
diff --git a/src/zenutil/cloud/imdscredentials.cpp b/src/zenutil/cloud/imdscredentials.cpp index 5a6cf45d2..b025eb6da 100644 --- a/src/zenutil/cloud/imdscredentials.cpp +++ b/src/zenutil/cloud/imdscredentials.cpp @@ -213,7 +213,7 @@ ImdsCredentialProvider::FetchCredentials() } else { - // Expiration is in the past or unparseable — force refresh next time + // Expiration is in the past or unparseable - force refresh next time NewExpiresAt = std::chrono::steady_clock::now(); } @@ -369,7 +369,7 @@ TEST_CASE("imdscredentials.fetch_from_mock") TEST_CASE("imdscredentials.unreachable_endpoint") { - // Point at a non-existent server — should return empty credentials, not crash + // Point at a non-existent server - should return empty credentials, not crash ImdsCredentialProviderOptions Opts; Opts.Endpoint = "http://127.0.0.1:1"; // unlikely to have anything listening Opts.ConnectTimeout = std::chrono::milliseconds(100); diff --git a/src/zenutil/cloud/minioprocess.cpp b/src/zenutil/cloud/minioprocess.cpp index e146f6677..2db0010dc 100644 --- a/src/zenutil/cloud/minioprocess.cpp +++ b/src/zenutil/cloud/minioprocess.cpp @@ -102,7 +102,7 @@ struct MinioProcess::Impl { if (m_DataDir.empty()) { - ZEN_WARN("MinIO: Cannot create bucket before data directory is initialized — call SpawnMinioServer() first"); + ZEN_WARN("MinIO: Cannot create bucket before data directory is initialized - call SpawnMinioServer() first"); return; } diff --git a/src/zenutil/cloud/mockimds.cpp b/src/zenutil/cloud/mockimds.cpp index 6919fab4d..88b348ed6 100644 --- a/src/zenutil/cloud/mockimds.cpp +++ b/src/zenutil/cloud/mockimds.cpp @@ -93,7 +93,7 @@ MockImdsService::HandleAwsRequest(HttpServerRequest& Request) return; } - // Autoscaling lifecycle state — 404 when not in an ASG + // Autoscaling lifecycle state - 404 when not in an ASG if (Uri == "latest/meta-data/autoscaling/target-lifecycle-state") { if (Aws.AutoscalingState.empty()) @@ -105,7 +105,7 @@ MockImdsService::HandleAwsRequest(HttpServerRequest& Request) return; } - // Spot interruption notice — 404 when no interruption pending + // Spot interruption notice - 404 when no interruption pending if (Uri == "latest/meta-data/spot/instance-action") { if (Aws.SpotAction.empty()) @@ -117,7 +117,7 @@ MockImdsService::HandleAwsRequest(HttpServerRequest& Request) return; } - // IAM role discovery — returns the role name + // IAM role discovery - returns the role name if (Uri == "latest/meta-data/iam/security-credentials/") { if (Aws.IamRoleName.empty()) diff --git a/src/zenutil/cloud/s3client.cpp b/src/zenutil/cloud/s3client.cpp index ef4b344ce..83238f5cc 100644 --- a/src/zenutil/cloud/s3client.cpp +++ b/src/zenutil/cloud/s3client.cpp @@ -932,7 +932,7 @@ TEST_CASE("s3client.minio_integration") using namespace std::literals; // Spawn a single MinIO server for the entire test case. Previously each SUBCASE re-entered - // the TEST_CASE from the top, spawning and killing MinIO per subcase — slow and flaky on + // the TEST_CASE from the top, spawning and killing MinIO per subcase - slow and flaky on // macOS CI. Sequential sections avoid the re-entry while still sharing one MinIO instance // that is torn down via RAII at scope exit. MinioProcessOptions MinioOpts; diff --git a/src/zenutil/consoletui.cpp b/src/zenutil/consoletui.cpp index 124132aed..10e8abb31 100644 --- a/src/zenutil/consoletui.cpp +++ b/src/zenutil/consoletui.cpp @@ -311,7 +311,7 @@ TuiPickOne(std::string_view Title, std::span<const std::string> Items) printf("\033[1;7m"); // bold + reverse video } - // \xe2\x96\xb6 = U+25B6 BLACK RIGHT-POINTING TRIANGLE (▶) + // \xe2\x96\xb6 = U+25B6 BLACK RIGHT-POINTING TRIANGLE (>) const char* Indicator = IsSelected ? " \xe2\x96\xb6 " : " "; printf("%s%s", Indicator, Items[i].c_str()); @@ -328,7 +328,7 @@ TuiPickOne(std::string_view Title, std::span<const std::string> Items) printf("\r\033[K\n"); // Hint footer - // \xe2\x86\x91 = U+2191 ↑ \xe2\x86\x93 = U+2193 ↓ + // \xe2\x86\x91 = U+2191 ^ \xe2\x86\x93 = U+2193 v printf( "\r\033[K \033[2m\xe2\x86\x91/\xe2\x86\x93\033[0m navigate " "\033[2mEnter\033[0m confirm " diff --git a/src/zenutil/consul/consul.cpp b/src/zenutil/consul/consul.cpp index 430ad0e32..c372b131d 100644 --- a/src/zenutil/consul/consul.cpp +++ b/src/zenutil/consul/consul.cpp @@ -245,7 +245,7 @@ ConsulClient::DeregisterService(std::string_view ServiceId) return true; } - // Agent deregister failed — fall back to catalog deregister. + // Agent deregister failed - fall back to catalog deregister. // This handles cases where the service was registered via a different Consul agent // (e.g. load-balanced endpoint routing to different agents). std::string NodeName = GetNodeName(); diff --git a/src/zenutil/include/zenutil/cloud/mockimds.h b/src/zenutil/include/zenutil/cloud/mockimds.h index d0c0155b0..28e1e8ba6 100644 --- a/src/zenutil/include/zenutil/cloud/mockimds.h +++ b/src/zenutil/include/zenutil/cloud/mockimds.h @@ -23,7 +23,7 @@ namespace zen::compute { * * When a request arrives for a provider that is not the ActiveProvider, the * mock returns 404, causing CloudMetadata to write a sentinel file and move - * on to the next provider — exactly like a failed probe on bare metal. + * on to the next provider - exactly like a failed probe on bare metal. * * All config fields are public and can be mutated between poll cycles to * simulate state changes (e.g. a spot interruption appearing mid-run). @@ -45,13 +45,13 @@ public: std::string AvailabilityZone = "us-east-1a"; std::string LifeCycle = "on-demand"; // "spot" or "on-demand" - // Empty string → endpoint returns 404 (instance not in an ASG). - // Non-empty → returned as the response body. "InService" means healthy; + // Empty string -> endpoint returns 404 (instance not in an ASG). + // Non-empty -> returned as the response body. "InService" means healthy; // anything else (e.g. "Terminated:Wait") triggers termination detection. std::string AutoscalingState; - // Empty string → endpoint returns 404 (no spot interruption). - // Non-empty → returned as the response body, signalling a spot reclaim. + // Empty string -> endpoint returns 404 (no spot interruption). + // Non-empty -> returned as the response body, signalling a spot reclaim. std::string SpotAction; // IAM credential fields for ImdsCredentialProvider testing @@ -69,10 +69,10 @@ public: std::string Location = "eastus"; std::string Priority = "Regular"; // "Spot" or "Regular" - // Empty → instance is not in a VM Scale Set (no autoscaling). + // Empty -> instance is not in a VM Scale Set (no autoscaling). std::string VmScaleSetName; - // Empty → no scheduled events. Set to "Preempt", "Terminate", or + // Empty -> no scheduled events. Set to "Preempt", "Terminate", or // "Reboot" to simulate a termination-class event. std::string ScheduledEventType; std::string ScheduledEventStatus = "Scheduled"; diff --git a/src/zenutil/include/zenutil/consoletui.h b/src/zenutil/include/zenutil/consoletui.h index 22737589b..49bb0cc92 100644 --- a/src/zenutil/include/zenutil/consoletui.h +++ b/src/zenutil/include/zenutil/consoletui.h @@ -30,7 +30,7 @@ bool IsTuiAvailable(); // - Title: a short description printed once above the list // - Items: pre-formatted display labels, one per selectable entry // -// Arrow keys (↑/↓) navigate the selection, Enter confirms, Esc cancels. +// Arrow keys (^/v) navigate the selection, Enter confirms, Esc cancels. // Returns the index of the selected item, or -1 if the user cancelled. // // Precondition: IsTuiAvailable() must be true. diff --git a/src/zenutil/include/zenutil/process/subprocessmanager.h b/src/zenutil/include/zenutil/process/subprocessmanager.h index e16c0c446..95d7fa43d 100644 --- a/src/zenutil/include/zenutil/process/subprocessmanager.h +++ b/src/zenutil/include/zenutil/process/subprocessmanager.h @@ -97,7 +97,7 @@ public: /// If Options.StdoutPipe is set, the pipe is consumed and async reading /// begins automatically. Similarly for Options.StderrPipe. When providing /// pipes, pass the corresponding data callback here so it is installed - /// before the first async read completes — setting it later via + /// before the first async read completes - setting it later via /// SetStdoutCallback risks losing early output. /// /// Returns a non-owning pointer valid until Remove() or manager destruction. @@ -112,7 +112,7 @@ public: /// Adopt an already-running process by handle. Takes ownership of handle internals. ManagedProcess* Adopt(ProcessHandle&& Handle, ProcessExitCallback OnExit); - /// Stop monitoring a process by pid. Does NOT kill the process — call + /// Stop monitoring a process by pid. Does NOT kill the process - call /// process->Kill() first if needed. The exit callback will not fire after /// this returns. void Remove(int Pid); @@ -219,7 +219,7 @@ private: /// A group of managed processes with OS-level backing. /// /// On Windows: backed by a JobObject. All processes assigned on spawn. -/// Kill-on-close guarantee — if the group is destroyed, the OS terminates +/// Kill-on-close guarantee - if the group is destroyed, the OS terminates /// all member processes. /// On Linux/macOS: uses setpgid() so children share a process group. /// Enables bulk signal delivery via kill(-pgid, sig). diff --git a/src/zenutil/include/zenutil/sessionsclient.h b/src/zenutil/include/zenutil/sessionsclient.h index aca45e61d..12ff5e593 100644 --- a/src/zenutil/include/zenutil/sessionsclient.h +++ b/src/zenutil/include/zenutil/sessionsclient.h @@ -35,13 +35,13 @@ public: SessionsServiceClient(const SessionsServiceClient&) = delete; SessionsServiceClient& operator=(const SessionsServiceClient&) = delete; - /// POST /sessions/{id} — register or re-announce the session with optional metadata. + /// POST /sessions/{id} - register or re-announce the session with optional metadata. [[nodiscard]] bool Announce(CbObjectView Metadata = {}); - /// PUT /sessions/{id} — update metadata on an existing session. + /// PUT /sessions/{id} - update metadata on an existing session. [[nodiscard]] bool UpdateMetadata(CbObjectView Metadata = {}); - /// DELETE /sessions/{id} — remove the session. + /// DELETE /sessions/{id} - remove the session. [[nodiscard]] bool Remove(); /// Create a logging sink that forwards log messages to the session's log endpoint. diff --git a/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h b/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h index f4ac5ff22..4387e616a 100644 --- a/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h +++ b/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h @@ -85,12 +85,12 @@ public: void Flush() override { - // Nothing to flush — writes happen asynchronously + // Nothing to flush - writes happen asynchronously } void SetFormatter(std::unique_ptr<logging::Formatter> /*InFormatter*/) override { - // Not used — we output the raw payload directly + // Not used - we output the raw payload directly } private: @@ -124,7 +124,7 @@ private: { break; // don't retry during shutdown } - continue; // drop batch — will retry on next batch + continue; // drop batch - will retry on next batch } // Build a gathered buffer sequence so the entire batch is written @@ -176,7 +176,7 @@ private: std::string m_Source; uint32_t m_MaxQueueSize; - // Sequence counter — incremented atomically by Log() callers. + // Sequence counter - incremented atomically by Log() callers. // Gaps in the sequence seen by the receiver indicate dropped messages. std::atomic<uint64_t> m_NextSequence{0}; diff --git a/src/zenutil/logging/logging.cpp b/src/zenutil/logging/logging.cpp index df0d6b9d2..c1636da61 100644 --- a/src/zenutil/logging/logging.cpp +++ b/src/zenutil/logging/logging.cpp @@ -124,7 +124,7 @@ BeginInitializeLogging(const LoggingOptions& LogOptions) LoggerRef DefaultLogger = zen::logging::Default(); - // Build the broadcast sink — a shared indirection point that all + // Build the broadcast sink - a shared indirection point that all // loggers cloned from the default will share. Adding or removing // a child sink later is immediately visible to every logger. std::vector<logging::SinkPtr> BroadcastChildren; diff --git a/src/zenutil/logging/rotatingfilesink.cpp b/src/zenutil/logging/rotatingfilesink.cpp index 23cf60d16..df59af5fe 100644 --- a/src/zenutil/logging/rotatingfilesink.cpp +++ b/src/zenutil/logging/rotatingfilesink.cpp @@ -85,7 +85,7 @@ struct RotatingFileSink::Impl m_CurrentSize = m_CurrentFile.FileSize(OutEc); if (OutEc) { - // FileSize failed but we have an open file — reset to 0 + // FileSize failed but we have an open file - reset to 0 // so we can at least attempt writes from the start m_CurrentSize = 0; OutEc.clear(); diff --git a/src/zenutil/process/asyncpipereader.cpp b/src/zenutil/process/asyncpipereader.cpp index 2fdcda30d..8eac350c6 100644 --- a/src/zenutil/process/asyncpipereader.cpp +++ b/src/zenutil/process/asyncpipereader.cpp @@ -50,7 +50,7 @@ struct AsyncPipeReader::Impl int Fd = Pipe.ReadFd; - // Close the write end — child already has it + // Close the write end - child already has it Pipe.CloseWriteEnd(); // Set non-blocking @@ -156,7 +156,7 @@ CreateOverlappedStdoutPipe(StdoutPipeHandles& OutPipe) // The read end should not be inherited by the child SetHandleInformation(ReadHandle, HANDLE_FLAG_INHERIT, 0); - // Open the client (write) end — inheritable, for the child process + // Open the client (write) end - inheritable, for the child process SECURITY_ATTRIBUTES Sa; Sa.nLength = sizeof(Sa); Sa.lpSecurityDescriptor = nullptr; @@ -202,7 +202,7 @@ struct AsyncPipeReader::Impl HANDLE ReadHandle = static_cast<HANDLE>(Pipe.ReadHandle); - // Close the write end — child already has it + // Close the write end - child already has it Pipe.CloseWriteEnd(); // Take ownership of the read handle diff --git a/src/zenutil/process/subprocessmanager.cpp b/src/zenutil/process/subprocessmanager.cpp index 597df3c15..d0b912a0d 100644 --- a/src/zenutil/process/subprocessmanager.cpp +++ b/src/zenutil/process/subprocessmanager.cpp @@ -1447,7 +1447,7 @@ TEST_CASE("SubprocessManager.RemoveWhileRunning") // Let it start IoContext.run_for(100ms); - // Remove without killing — callback should NOT fire after this + // Remove without killing - callback should NOT fire after this Manager.Remove(Pid); IoContext.run_for(500ms); @@ -1756,7 +1756,7 @@ TEST_CASE("ProcessGroup.FindGroup") TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) { - // Seed for reproducibility — change to explore different orderings + // Seed for reproducibility - change to explore different orderings // // Note that while this is a stress test, it is still single-threaded @@ -1785,7 +1785,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 1: Spawn multiple groups with varied workloads // ======================================================================== - ZEN_INFO("StressTest: Phase 1 — spawning initial groups"); + ZEN_INFO("StressTest: Phase 1 - spawning initial groups"); constexpr int NumInitialGroups = 8; std::vector<std::string> GroupNames; @@ -1839,7 +1839,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 2: Randomly kill some groups, create replacements, add ungrouped // ======================================================================== - ZEN_INFO("StressTest: Phase 2 — random group kills and replacements"); + ZEN_INFO("StressTest: Phase 2 - random group kills and replacements"); constexpr int NumGroupsToKill = 3; @@ -1904,7 +1904,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 3: Rapid spawn/exit churn // ======================================================================== - ZEN_INFO("StressTest: Phase 3 — rapid spawn/exit churn"); + ZEN_INFO("StressTest: Phase 3 - rapid spawn/exit churn"); std::atomic<int> ChurnExitCount{0}; int TotalChurnSpawned = 0; @@ -1928,7 +1928,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Brief pump to allow some exits to be processed IoContext.run_for(200ms); - // Destroy the group — any still-running processes get killed + // Destroy the group - any still-running processes get killed Manager.DestroyGroup(Name); } @@ -1938,7 +1938,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 4: Drain and verify // ======================================================================== - ZEN_INFO("StressTest: Phase 4 — draining remaining processes"); + ZEN_INFO("StressTest: Phase 4 - draining remaining processes"); // Check metrics were collected before we wind down AggregateProcessMetrics Agg = Manager.GetAggregateMetrics(); @@ -1969,7 +1969,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // (exact count is hard to predict due to killed groups, but should be > 0) CHECK(TotalExitCallbacks.load() > 0); - ZEN_INFO("StressTest: PASSED — seed={}", Seed); + ZEN_INFO("StressTest: PASSED - seed={}", Seed); } TEST_SUITE_END(); diff --git a/src/zenutil/sessionsclient.cpp b/src/zenutil/sessionsclient.cpp index c62cc4099..df8853d20 100644 --- a/src/zenutil/sessionsclient.cpp +++ b/src/zenutil/sessionsclient.cpp @@ -21,7 +21,7 @@ namespace zen { ////////////////////////////////////////////////////////////////////////// // -// SessionLogSink — batching log sink that forwards to /sessions/{id}/log +// SessionLogSink - batching log sink that forwards to /sessions/{id}/log // static const char* @@ -108,7 +108,7 @@ public: void SetFormatter(std::unique_ptr<logging::Formatter> /*InFormatter*/) override { - // No formatting needed — we send raw message text + // No formatting needed - we send raw message text } private: @@ -226,7 +226,7 @@ private: } catch (const std::exception&) { - // Best-effort — silently discard on failure + // Best-effort - silently discard on failure } } diff --git a/src/zenutil/splitconsole/logstreamlistener.cpp b/src/zenutil/splitconsole/logstreamlistener.cpp index 289bc73a2..df985a196 100644 --- a/src/zenutil/splitconsole/logstreamlistener.cpp +++ b/src/zenutil/splitconsole/logstreamlistener.cpp @@ -17,7 +17,7 @@ ZEN_THIRD_PARTY_INCLUDES_END namespace zen { ////////////////////////////////////////////////////////////////////////// -// LogStreamSession — reads CbObject-framed messages from a single TCP connection +// LogStreamSession - reads CbObject-framed messages from a single TCP connection class LogStreamSession : public RefCounted { @@ -34,7 +34,7 @@ private: [Self](const asio::error_code& Ec, std::size_t BytesRead) { if (Ec) { - return; // connection closed or error — session ends + return; // connection closed or error - session ends } Self->m_BufferUsed += BytesRead; Self->ProcessBuffer(); @@ -119,7 +119,7 @@ private: m_BufferUsed -= Consumed; } - // If buffer is full and we can't parse a message, the message is too large — drop connection + // If buffer is full and we can't parse a message, the message is too large - drop connection if (m_BufferUsed == m_ReadBuf.size()) { ZEN_WARN("LogStreamSession: buffer full with no complete message, dropping connection"); @@ -141,7 +141,7 @@ private: struct LogStreamListener::Impl { - // Owned io_context mode — creates and runs its own thread + // Owned io_context mode - creates and runs its own thread Impl(LogStreamTarget& Target, uint16_t Port) : m_Target(Target) , m_OwnedIoContext(std::make_unique<asio::io_context>()) @@ -154,7 +154,7 @@ struct LogStreamListener::Impl }); } - // External io_context mode — caller drives the io_context + // External io_context mode - caller drives the io_context Impl(LogStreamTarget& Target, asio::io_context& IoContext, uint16_t Port) : m_Target(Target), m_Acceptor(IoContext) { SetupAcceptor(Port); @@ -367,7 +367,7 @@ TEST_CASE("DroppedMessageDetection") asio::ip::tcp::socket Socket(IoContext); Socket.connect(asio::ip::tcp::endpoint(asio::ip::make_address("127.0.0.1"), Listener.GetPort())); - // Send seq=0, then seq=5 — the listener should detect a gap of 4 + // Send seq=0, then seq=5 - the listener should detect a gap of 4 for (uint64_t Seq : {uint64_t(0), uint64_t(5)}) { CbObjectWriter Writer; |