aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil/include
Commit message (Collapse)AuthorAgeFilesLines
...
* workspace shares (#84)Dan Engelbrecht2024-05-291-0/+27
| | | Feature: New 'workspaces' service which allows a user to share a local folder via zenserver. A workspace can have mulitple workspace shares and they provie an HTTP API that is compatible with the project oplog HTTP API. Workspaces and shares are preserved between runs. Workspaces feature is disabled by default - enable with --workspaces-enabled option when launching zenserver.
* use write and move in place for safer writing of files (#70)Dan Engelbrecht2024-05-021-0/+2
| | | * use write and move in place for safer writing of files
* miscellaneous minor bugfixes (#66)v5.5.0Stefan Boberg2024-04-261-5/+10
| | | | | | | | this change addresses some TSAN warnings for improved robustness and less TSAN noise - Added dedicated timer for EnqueueStateExitFlagTimer - Made log formatter `fullformatter` output consistent time stamps across threads - Made Linux/Mac event implementation TSAN clean
* zenserverprocess hardening (#61)Dan Engelbrecht2024-04-251-12/+12
| | | | * verify running process before creating event * make sure we don't signal/wait for a zenserver instance that we did not wait for to get ready
* import oplog improvements (#54)Dan Engelbrecht2024-04-201-1/+1
| | | | | | | | | | | * 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
* capture zenserver output on error (#51)Dan Engelbrecht2024-04-181-1/+3
| | | | * capture spawned server output and output on launch error * fix logging and launch validation in tests
* improved lock file handling (#50)Dan Engelbrecht2024-04-181-2/+19
| | | | | | | | | | | | - 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-0/+3
| | | | | | | | | | | | | - 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-5/+5
| | | | - 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
* Use multithreading to fetch size/rawsize of entries in ↵Dan Engelbrecht2024-03-281-2/+5
| | | | | | `/prj/{project}/oplog/{log}/chunkinfos` and `/prj/{project}/oplog/{log}/files` (#30) - Improvement: Use multithreading to fetch size/rawsize of entries in `/prj/{project}/oplog/{log}/chunkinfos` and `/prj/{project}/oplog/{log}/files` - Improvement: Add `GetMediumWorkerPool()` in addition to `LargeWorkerPool()` and `SmallWorkerPool()`
* re-enable partial cache chunks (#21)v5.4.2-pre9v5.4.2-pre12v5.4.2-pre11v5.4.2-pre10Dan Engelbrecht2024-03-221-4/+5
| | | | * Separate chunk raw hash from section hash (how to find the fragment attachment) * fix partial get cache value tests
* add support for responding with partial cache chunks (#11)Dan Engelbrecht2024-03-212-4/+6
| | | * add support for responding with partial cache chunks
* special treatment large oplog attachments v2 (#5)Dan Engelbrecht2024-03-141-1/+2
| | | | | - Bugfix: Install Ctrl+C handler earlier when doing `zen oplog-export` and `zen oplog-export` to properly cancel jobs - Improvement: Add ability to block a set of CAS entries from GC in project store - Improvement: Large attachments and loose files are now split into smaller chunks and stored in blocks during oplog export
* clean up test linking (#4)Dan Engelbrecht2024-03-142-1/+7
| | | | | | | - Improvement: Add zenhttp-test and zenutil-test - Improvement: Moved cachepolicy test to cachepolicy.cpp - Improvement: Renamed cachestore tests from z$ to cachestore - Improvement: Moved test linking so test for a lib is linked by <lib>-test - Improvement: Removed HttpRequestParseRelativeUri in httpstructuredcache.cpp and use the one in cacherequests.h instead
* changed RPC recording to MPSC setup (#638)Stefan Boberg2024-01-311-6/+3
| | | fixes rare race condition when using RPC recording for long periods of time
* separate RPC processing from HTTP processing (#626)Stefan Boberg2023-12-201-0/+163
| | | | | | * moved all RPC processing from HttpStructuredCacheService into separate CacheRpcHandler class in zenstore * move package marshaling to zenutil. was previously in zenhttp/httpshared but it's useful in other contexts as well where we don't want to depend on zenhttp * introduced UpstreamCacheClient, this provides a subset of functions on UpstreamCache and lives in zenstore
* fixed v2 rpc recording issue with >4GB data per segment (#612)Stefan Boberg2023-12-151-0/+6
| | | | | | | | | * fixed v2 rpc recording issue with >4GB data per segment * implemented recovery logic to deal with partial RPC recordings * added check for invalid/null requests in RPC replay * also made sure at least one worker thread is configured * fix problem where "null" requests would cause infinite loop! * added basic RPC recorder tests
* multi-line logging improvements (#597)Stefan Boberg2023-12-111-70/+109
| | | | | | * added ZEN_SCOPED_WARN and implemented multi-line logging * changed so file log also uses `fullformatter` for consistency and to get the multi-line support across the board
* global thread worker pools (#577)Dan Engelbrecht2023-11-291-0/+21
| | | - Improvement: Use two global worker thread pools instead of ad-hoc creation of worker pools
* optimized index snapshot reading/writing (#561)Stefan Boberg2023-11-272-1/+36
| | | | | the previous implementation of in-memory index snapshots serialise data to memory before writing to disk and vice versa when reading. This leads to some memory spikes which end up pushing useful data out of system cache and also cause stalls on I/O operations. this change moves more code to a streaming serialisation approach which scales better from a memory usage perspective and also performs much better
* moved process handling code into separate h/cpp (#555)Stefan Boberg2023-11-201-0/+1
|
* use dynamic port assignment for tests (#545)Stefan Boberg2023-11-171-4/+20
| | | this change replaces hard-coded port numbers in tests with dynamically assigned ports, to avoid potential issues around socket lifetimes and re-use policies
* blocking queue fix (#550)Dan Engelbrecht2023-11-161-0/+2
| | | | | | | | | * make BlockingQueue::m_CompleteAdding non-atomic * ZenCacheDiskLayer::Flush logging * name worker threads in ZenCacheDiskLayer::DiscoverBuckets * name worker threads in gcv2 * improved logging in ZenServerInstance * scrub threadpool naming * remove waitpid handling, we should just call wait to kill zombie processes
* gc history log (#519)Dan Engelbrecht2023-11-131-59/+10
| | | | | - Feature: Writes a `gc.log` with settings and detailed result after each GC execution (version 2 only) - Break out file name rotate to allow access for gclog - CompactBinaryToJson(MemoryView Data, StringBuilderBase& InBuilder)
* factored out some compiler definitions etc into zenbase (#517)Stefan Boberg2023-11-072-1/+3
| | | | | this is a header-only library which mostly contains definitions to support different platforms and compilers. It is part of the zen codebase but is intended to be consumable separately to zenbase etc to support standalone transport plug-ins and similar.
* spdlog implementation hiding (#498)Stefan Boberg2023-11-063-37/+175
| | | | | | | | | this change aims to hide logging internals from client code, in order to make it easier to extend and take more control over the logging process in the future. As a bonus side effect, the generated code is much tighter (net delta around 2.5% on the resulting executable which includes lots of thirdparty code) and should take less time to compile and link. Client usage via macros is pretty much unchanged. The main exposure client code had to spdlog internals before was the use of custom loggers per subsystem, where it would be common to have `spdlog::logger` references to keep a reference to a logger within a class. This is now replaced by `zen::LoggerRef` which currently simply encapsulates an actual `spdlog::logger` instance, but this is intended to be an implementation detail which will change in the future. The way the change works is that we now handle any formatting of log messages in the zencore logging subsystem instead of relying on `spdlog` to manage this. We use the `fmt` library to do the formatting which means the client usage is identical to using `spdlog`. The formatted message is then forwarded onto any sinks etc which are still implememted via `spdlog`.
* statsd for cas (#511)Dan Engelbrecht2023-11-061-0/+34
| | | | * separate statsd interfaces so they can be accessible to zenstore * statsd for cas
* added missing includes (#504)Stefan Boberg2023-10-272-0/+3
| | | | | this change adds some includes to files which "inherit" includes from elsewhere this was exposed on another branch when removing some heavy dependencies from central headers
* eliminate redundant logging code (#499)Stefan Boberg2023-10-254-3/+617
| | | | | | | | | zenutil and zenserver both contain very similar logging setup code and this change aims to make them have most code in common. * fullformatter/jsonformatter/RotatingFileSink are moved into dedicated header files in zenutil * zenserver `InitializeLogging`/`ShutdownLogging` are renamed `InitializeServerLogging`/`InitializeServerLogging` * these now call into the common zenutil `BeginInitializeLogging`/`FinishInitializeLogging` in addition to setting up server custom logging * `std::filesystem::path` is now logged after stripping any `\\\\?\\` prefix for readability
* New rotating file logger that keeps on running regardless of errors (#495)Dan Engelbrecht2023-10-251-0/+2
| | | * New rotating file logger that keeps on running regardless of errors
* more cleanup from sb/protoStefan Boberg2023-10-202-16/+23
|
* Cache (rpc) activitity recording improvements (#482)Stefan Boberg2023-10-201-6/+17
| | | | | | | this adds a new RPC recording path aimed at more continuous recording and analysis of recorded sessions the new strategy is implemented alongside the original in order to retain the ability to read the older format the main difference between v2 and v1 is that the new strategy splits the recording into segments which are independent from each other. This is done to enable long running sessions with automatic disk cleanup (not implemented yet), appending to an existing recording (not implemented) and/or partial analysis and processing. The recorder will start a new segment when some criteria is fulfilled, including the number of files in the segment directory, disk footprint etc
* faster oplog iteration (#471)Dan Engelbrecht2023-10-131-1/+2
| | | | | * use a CbObjectView instead of CbObject to avoid creating IOBufferCore instances * use BasicFileBuffer directly where possible * changelog
* added logging utility functions (from sb/proto) (#469)Stefan Boberg2023-10-121-0/+33
| | | these allow standalone programs to share much of the logging setup from zenserver
* retry file create (#383)Dan Engelbrecht2023-09-041-0/+1
| | | | | * add retry logic when creating files * only write disk usage log if disk writes are allowed * changelog
* Fix construction order in OpenProcessCache (#374)Dan Engelbrecht2023-08-221-1/+1
|
* buffered file reading for oplog (#366)Dan Engelbrecht2023-08-211-0/+23
| | | | | * add BasicFileBuffer for buffered read of BasicFile * Use BasicFileBuffer when reading oplog * changelog
* Cache process handles for FormatPackageMessage (#360)Dan Engelbrecht2023-08-171-0/+39
|
* * added file sharing control to BasicFile (required to implement lockfiles)Stefan Boberg2023-06-301-6/+18
| | | | | * added delete-on-close support to BasicFile * added BasicFile::ReadRange()
* added ZenServerInstance::SpawnServerAndWait (#334)Stefan Boberg2023-06-161-2/+14
| | | | | this change adds `ZenServerInstance::SpawnServerAndWait()` which as the name implies spawns a server and then waits for the instance to reach a usable state before returning to the caller. It also changes the behaviour of `ZenServerInstance::AttachToRunningServer()` so it matches the Spawn behaviour wrt automatic termination on ZenServerInstance destruction. Previously it would always terminate the subprocess on exit.
* cache log sessionid (#297)Stefan Boberg2023-05-231-0/+28
| | | | | | | | | | | * implemented structured cache logging to be used as audit trail to help analyse potential cache pollution/corruption * added common header to all known log targets * made Oid::operator bool explicit to avoid logging/text format mishaps * HttpClient::operator bool -> explicit * changed cache logs to not rotate on start in order to retain more history * added CacheRequestContext * properly initialize request context * log session id and request id on zencacehstore get/put * changelog
* Added some comments to ZenServerInstance etcStefan Boberg2023-05-151-10/+18
|
* moved source directories into `/src` (#264)Stefan Boberg2023-05-027-0/+881
* moved source directories into `/src` * updated bundle.lua for new `src` path * moved some docs, icon * removed old test trees