aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil
Commit message (Collapse)AuthorAgeFilesLines
* add cmake build config to be able to use cliondi/add_cmake_devDmytro Ivanov2024-10-022-0/+3
|
* made fmt formatter format function const (#162)Stefan Boberg2024-09-201-1/+1
| | | this appears to be required as of fmt v11
* clean cache slog files on startup (#143)Dan Engelbrecht2024-09-041-0/+7
| | | | - Bugfix: If we fail to move a temporary file into place, try to re-open the file so we clean it up - Improvement: Clean up cache bucket log files at startup as we store the matching information in the index snapshot for the bucket
* meta info store (#75)Dan Engelbrecht2024-08-304-12/+161
| | | | - Feature: Added option `--gc-cache-attachment-store` which caches referenced attachments in cache records on disk for faster GC - default is `false` - Feature: Added option `--gc-projectstore-attachment-store` which caches referenced attachments in project store oplogs on disk for faster GC - default is `false`
* zenserver process launch/termination improvements (#138)Dan Engelbrecht2024-08-272-70/+143
| | | | | | * zenserver process launch/termination improvements * fix GetPidStatus to return error code on Linux * fix linux FindProcess() * cleanup IsZombieProcess
* separate worker pools into burst/background to avoid background jobs ↵Dan Engelbrecht2024-08-222-73/+57
| | | | blocking client requests (#134)
* safer calls to IsProcessRunning (#131)Dan Engelbrecht2024-08-221-11/+43
| | | * safer calls to IsProcessRunning to handle cases where we can't check status of processes
* adds more information in log when oplog rename/delete fails (#117)Dan Engelbrecht2024-08-151-0/+4
| | | | | | * adds more information in log when oplog rename/delete fails * warn if we fail to delete dropped directory * close oplog storage file inside try/catch * don't try to flush closed files
* Skip open process handle caching if we don't have a session id (#94)Dan Engelbrecht2024-06-131-0/+4
| | | * Don't try to cache process handle if we don't have a session id
* Use a smaller thread pool for network operations when doing oplog import to ↵Dan Engelbrecht2024-05-301-1/+1
| | | | | reduce risk NIC/router failure (#89) Medium worker pool now uses a minimum of 2 threads (up from 1)
* cache optimizations (#88)Dan Engelbrecht2024-05-301-35/+27
| | | | | * message formatting optimizations * bump iostorecompression small value threshold to 1MB
* workspace shares (#84)Dan Engelbrecht2024-05-293-0/+180
| | | 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.
* added logic to change default HTTP server implementation when running on ↵Stefan Boberg2024-05-021-3/+8
| | | | | | Wine (#71) * added logic to change default HTTP server implementation when running on Wine * added log message to inform user about potential problems when running under Wine
* fix zero size attachment replies (#69)Dan Engelbrecht2024-05-021-0/+12
| | | | - Bugfix: Don't try to respond with zero size partial cache value when partial size is zero - Improvement: Added more validation of data read from cache / cas
* use write and move in place for safer writing of files (#70)Dan Engelbrecht2024-05-022-0/+22
| | | * use write and move in place for safer writing of files
* fix get project files loop (#68)Dan Engelbrecht2024-04-301-17/+30
| | | | | - Bugfix: Remove extra loop causing GetProjectFiles for project store to find all chunks once for each chunk found - Bugfix: Don't capture ChunkIndex variable in CasImpl::IterateChunks by reference as it causes crash - Improvement: Make FileCasStrategy::IterateChunks (optionally) multithreaded (improves GetProjectFiles performance)
* 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-252-21/+40
| | | | * 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-202-4/+6
| | | | | | | | | | | * 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-182-23/+86
| | | | * capture spawned server output and output on launch error * fix logging and launch validation in tests
* improved lock file handling (#50)Dan Engelbrecht2024-04-182-12/+122
| | | | | | | | | | | | - 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-172-10/+77
| | | | | | | | | | | | | - 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
* Validate input buffer size when trying to parse package message (#47)Dan Engelbrecht2024-04-131-21/+25
| | | | * add validation of input buffer size when trying to parse package message * avoid doing memcopy when parsing package message
* improved assert (#37)Dan Engelbrecht2024-04-043-14/+14
| | | | - 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
* hardening parsepackagemessage (#38)Dan Engelbrecht2024-04-041-31/+70
| | | * hardening of ParsePackageMessage and extended details when malformed attachments are detected
* Use multithreading to fetch size/rawsize of entries in ↵Dan Engelbrecht2024-03-282-4/+30
| | | | | | `/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()`
* consistent paths encoding (#24)Dan Engelbrecht2024-03-251-1/+1
| | | | * Don't encode filesystem path to UTF8 unless stored in compactbinary string * Be consistent where we encode/decode paths to UTF8
* re-enable partial cache chunks (#21)v5.4.2-pre9v5.4.2-pre12v5.4.2-pre11v5.4.2-pre10Dan Engelbrecht2024-03-222-7/+10
| | | | * Separate chunk raw hash from section hash (how to find the fragment attachment) * fix partial get cache value tests
* harden attach sponsor process (#14)Dan Engelbrecht2024-03-211-10/+7
| | | | | - Improvement: Delay exiting due to no sponsor processes by one second to handle race conditions - Improvement: Safer IsProcessRunning check - Improvement: make sure we can RequestApplicationExit safely from any thread
* add support for responding with partial cache chunks (#11)Dan Engelbrecht2024-03-213-5/+8
| | | * add support for responding with partial cache chunks
* improved process monitoring behaviour with invalid pids (#16)Stefan Boberg2024-03-211-1/+8
|
* special treatment large oplog attachments v2 (#5)Dan Engelbrecht2024-03-142-3/+12
| | | | | - 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-145-84/+260
| | | | | | | - 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
* fix zenserver state macos (#669)Dan Engelbrecht2024-03-101-1/+5
| | | | | | - Shared memory for zenserver state may hang around after all zenserver processes exit - make sure we find a valid entry in `zen up` before bailing - Httpasio add retry for desired port - Httpasio only call listen() once - Httpasio explicitly close acceptor sockets
* respond with BadRequest result instead of throwing exception on bad request ↵Dan Engelbrecht2024-02-051-8/+8
| | | | input (#648)
* added robin-map dependency to zenutilStefan Boberg2024-02-011-1/+1
|
* changed RPC recording to MPSC setup (#638)Stefan Boberg2024-01-312-70/+174
| | | fixes rare race condition when using RPC recording for long periods of time
* exception on basicfile read error (#642)Dan Engelbrecht2024-01-291-8/+28
| | | | | * Change BasicFile::Read to throw exception like IoBuffer - Don't ASSERT on dwNumberOfBytesRead == NumberOfBytesToRead - throw exception with details instead - Use proper return type for pread()
* make sure to advance read buffer pointer in BasicFileWriter::Write (#633)Dan Engelbrecht2024-01-221-1/+3
|
* reinstate formatter settings for file sink (#631)Stefan Boberg2024-01-171-0/+9
| | | fixes issue introduced in #615
* release RPC recording memory early (#627)Stefan Boberg2023-12-201-2/+7
| | | previously the segment would call `clear()` on the `m_Entries` vector but this does not release the backing memory so we have to do the `swap` dance
* separate RPC processing from HTTP processing (#626)Stefan Boberg2023-12-203-0/+992
| | | | | | * 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
* cache RPC recorder threading fixes (#617)Stefan Boberg2023-12-191-39/+48
| | | | | * ensure all access to m_Entries is done while holding lock * RPC recorder concurrency fixes - setup/teardown of recorder needs to be done while holding an exclusive lock. Calls into recorder should be done while holding a shared lock.
* Make sure we initialize the pattern of FileSink before it is added as a ↵Dan Engelbrecht2023-12-181-12/+8
| | | | usable logger (#615)
* fixed v2 rpc recording issue with >4GB data per segment (#612)Stefan Boberg2023-12-153-32/+203
| | | | | | | | | * 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
* implement cache recording segment split by age (#611)Stefan Boberg2023-12-141-12/+27
| | | - also fixes weird DateTime/TimeSpan comparison operator
* fix crash at log exit (#605)Dan Engelbrecht2023-12-131-7/+5
| | | * keep g_FileSink alive until spdlog has shut down
* premature logging shutdown fix (#603)v0.2.36Stefan Boberg2023-12-121-0/+9
|
* Make sure that PathFromHandle don't hide true error when throwing exceptions ↵Dan Engelbrecht2023-12-111-9/+23
| | | | | | | | | (#600) * Make sure that PathFromHandle don't hide true error when throwing exceptions * changelog * return error info in PathFromHandle if path fails to resolve
* multi-line logging improvements (#597)Stefan Boberg2023-12-112-72/+112
| | | | | | * 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