aboutsummaryrefslogtreecommitdiff
path: root/src/zencore
Commit message (Collapse)AuthorAgeFilesLines
* Add multithreading directory scanning in core/filesystem (#277)Dan Engelbrecht2025-01-223-29/+195
| | | | | | add DirectoryContent::IncludeFileSizes add DirectoryContent::IncludeAttributes add multithreaded GetDirectoryContent use multithreaded GetDirectoryContent in workspace folder scanning
* move basicfile.h/cpp -> zencore (#273)Dan Engelbrecht2025-01-163-0/+1220
| | | | | | move jupiter.h/cpp -> zenutil move packageformat.h/.cpp -> zenhttp zenutil now depends on zenhttp instead of the inverse
* increase limit for mmap path to 8kb (#270)Dan Engelbrecht2024-12-191-1/+1
|
* Miscellaneous minor LLM fixes (#268)v5.5.17-pre0Stefan Boberg2024-12-172-3/+5
| | | | | | | With this change, LLM tags are assigned using the name,parent tuple rather than just by name only. This allows tag hierarchies like `cache/store` and `project/store` which would previously get collapsed into the first pair seen when registering the `store` tag. This PR also adds some more LLM tag annotations to more accurately associate memory allocations with subsystems In addition, this PR also tweaks the frequency of timer marker events to increase the resolution in Insights and avoid some cases of Insights deciding that marker events are too far apart since we don't allocate as frequently as UE tends to.
* added test verification of XXH3_128Stream vs XXH3_128::HashMemoryStefan Boberg2024-12-131-0/+2
|
* fixed XXH3_128Stream so it initializes the state properlyStefan Boberg2024-12-132-3/+40
| | | | the old version is still present for now, with a _deprecated suffix
* added xxhash unit tests (which currently fail)Stefan Boberg2024-12-132-0/+46
|
* Memory tracking improvements (#262)Stefan Boberg2024-12-111-0/+3
| | | | | * added LLM tag to properly tag RPC allocations * annotated some more httpsys functions with memory tags * only emit memory scope events if the active tag is different from the new tag
* projectstore getchunks rpc with modtag (#244)Dan Engelbrecht2024-12-055-2/+51
| | | Feature: Project store "getchunks" rpc call /prj/{project}/oplog/{log}/rpc extended to accept both CAS (RawHash) and Id (Oid) identifiers as well as partial ranges
* Unity build fixes (#253)Stefan Boberg2024-12-052-0/+3
| | | some fixes to make everything build using unity build mode. Mostly moved code from anonymous namespaces into local impl namespace to avoid ambiguity in name resolution.
* reduce memory churn (#248)Stefan Boberg2024-12-024-6/+18
| | | | | * eliminated allocation in SetCurrentThreadName * reduced memory allocator activity in cache RPC response building * reduced allocations in compact binary building
* added support for dynamic LLM tags (#245)Stefan Boberg2024-12-029-31/+132
| | | | | * added FLLMTag which can be used to register memory tags outside of core * changed `UE_MEMSCOPE` -> `ZEN_MEMSCOPE` for consistency * instrumented some subsystems with dynamic tags
* split zencore/memory.h -> memoryview.h, memcmp.h (#228)Stefan Boberg2024-11-2518-51/+65
| | | | | | | minor clean-up `zencore/memory.h` used to contain a variety of things including `Malloc` support along with `MemoryView` etc since the memory allocator stuff moved into `zencore/memory/memory.h` there was basically only `MemoryView` and `MemCmp` in there which seemed better to split out into separate headers to avoid overloading `memory.h`
* Insights-compatible memory tracking (#214)Stefan Boberg2024-11-2545-100/+5946
| | | | | | | | | | | | | This change introduces support for tracing of memory allocation activity. The code is ported from UE5, and Unreal Insights can be used to analyze the output. This is currently only fully supported on Windows, but will be extended to Mac/Linux in the near future. To activate full memory tracking, pass `--trace=memory` on the commandline alongside `--tracehost=<ip>` or `-tracefile=<path>`. For more control over how much detail is traced you can instead pass some combination of `callstack`, `memtag`, `memalloc` instead. In practice, `--trace=memory` is an alias for `--trace=callstack,memtag,memalloc`). For convenience we also support `--trace=memory_light` which omits call stacks. This change also introduces multiple memory allocators, which may be selected via command-line option `--malloc=<allocator>`: * `mimalloc` - mimalloc (default, same as before) * `rpmalloc` - rpmalloc is another high performance allocator for multithreaded applications which may be a better option than mimalloc (to be evaluated). Due to toolchain limitations this is currently only supported on Windows. * `stomp` - an allocator intended to be used during development/debugging to help track down memory issues such as use-after-free or out-of-bounds access. Currently only supported on Windows. * `ansi` - fallback to default system allocator
* fix inconsistencies in filecas due to failing to remove payload file during ↵Dan Engelbrecht2024-11-221-2/+2
| | | | | | | | GC (#224) make sure we rewrite filecas entries if chunk size changes (due to compression changes) hardening of move/write files in filecas if we encounter a filecas entry with mismatching size (due to pre-existing bug) we validate the file and update the index if we find a bad filecas file on disk we now attempt to remove it
* fixed off-by-one in GetPidStatus (Linux) which might cause spurious errors ↵Stefan Boberg2024-11-221-2/+2
| | | | (#226)
* memory/string support cleanup and additions (#220)Stefan Boberg2024-11-199-181/+188
| | | | | | | | | * removed unused memory classes * added align.h alignment helpers used in upcoming changes * added char16_t StringLength * avoid memory alloc in SetCurrentThreadName * added command line parsing helpers to zencore/commandline.h * removed IoBuffer direct VirtualAlloc path
* Improved oplog import/export progress indicator at commandline (#206)Dan Engelbrecht2024-11-062-27/+48
| | | | Nicer progress bar during oplog import/export Verify that oplog has not been deleted from disk behind our back
* workspace share security (#192)Dan Engelbrecht2024-10-233-1/+33
| | | | | | | - Improvement: Reworked workspace shares to be more secure. Workspaces and workspace shares can only be created using the `zen workspace` command, the http endpoint is disabled unless zenserver is started with the `--workspaces-allow-changes` option enabled. - Each workspace are now configured via a `zenworkspaceconfig.json` file in the root of each workspace - A workspace can allow shares to be created via the http interface if the workspace is created with the `--allow-share-create-from-http` option enabled - A new http endpoint at `/ws` - issuing a `Get` operation will get you a list of workspaces - A new http endpoint at `/ws/refresh` - issuing a `Get` will make zenserver scan for edits in workspaces and workspace shares
* fix gc date (#204)Dan Engelbrecht2024-10-221-1/+1
| | | * fix month conversion in ToDateTime
* safer path from handle (#195)Dan Engelbrecht2024-10-164-23/+32
| | | * remove PathFromHandle that throws to give better context on failures
* cache get command (#183)Dan Engelbrecht2024-10-035-45/+45
| | | | * move TryParseObjectId and TryParseIoHash to Oid::TryParse and IoHash::TryParse respectively * zen cache-get command
* simplified CleanDirectory implementation (#182)Stefan Boberg2024-10-031-26/+8
| | | we use the std implementation for all normal cases now. The Windows-only path still exists for VFS cleanup
* optimize startup time (#175)Dan Engelbrecht2024-09-302-6/+6
| | | | | | * use tsl::robin_set for BlockIndexSet don't calculate full block location when only block index is needed * don't copy visitor function * reserve space for attachments
* reduce lock time for memcache trim (#171)Dan Engelbrecht2024-09-271-5/+1
| | | | | | | - Improvement: Faster memcache trimming - Reduce calculations while holding bucket lock for memcache trim analysis to reduce contention - When trimming memcache, evict 25% more than required to reduce frequency of trimming - When trimming memcache, don't repack memcache data vector, defer that to regular garbage collection - When trimming memcache, deallocate memcache buffers when not holding exclusive lock in bucket
* gc unused refactor (#165)Dan Engelbrecht2024-09-234-6/+47
| | | | | * optimize IoHash and OId comparisions * refactor filtering of unused references * add attachment filtering to gc
* made fmt formatter format function const (#162)Stefan Boberg2024-09-201-4/+4
| | | this appears to be required as of fmt v11
* A clang-format passMartin Ridgers2024-09-171-1/+1
|
* Explicitly tell dbghelp.dll to look for PDBs alongside Zen's binariesMartin Ridgers2024-09-171-1/+3
|
* gc performance improvements (#160)Dan Engelbrecht2024-09-172-14/+28
| | | | | | | | | | * optimized ValidateCbUInt * optimized iohash comparision * replace unordered set/map with tsl/robin set/map in blockstore * increase max buffer size when writing cache bucket sidecar * only store meta data for files < 4Gb * faster ReadAttachmentsFromMetaData * remove memcpy call in BlockStoreDiskLocation * only write cache bucket state to disk if GC deleted anything
* zenserver process launch/termination improvements (#138)Dan Engelbrecht2024-08-274-41/+114
| | | | | | * zenserver process launch/termination improvements * fix GetPidStatus to return error code on Linux * fix linux FindProcess() * cleanup IsZombieProcess
* handle "path not found" as well as "file not found" in directory travers on ↵Dan Engelbrecht2024-08-201-1/+1
| | | | windows (#129)
* improve logging on main failure (#111)Dan Engelbrecht2024-08-143-7/+11
| | | | | | * add support for indenting callstack output * Explicitly catch option-parse error and reduce log spam on bad parameters * add command line to sentry error reports * log command line at startup
* fix compilation issue with recent VS toolchains (#103)Stefan Boberg2024-08-071-2/+2
|
* improve iobuffer read error logs (#100)Dan Engelbrecht2024-08-061-23/+47
| | | * Make IoBufferExtendedCore::Materialize error reporting match Materialize
* Make sure we monitor for new project, oplogs, namespaces and buckets during ↵Dan Engelbrecht2024-06-131-0/+10
| | | | | | GCv2 (#93) - Bugfix: Make sure we monitor and include new project/oplogs created during GCv2 - Bugfix: Make sure we monitor and include new namespaces/cache buckets created during GCv2
* cache optimizations (#88)Dan Engelbrecht2024-05-303-4/+17
| | | | | * message formatting optimizations * bump iostorecompression small value threshold to 1MB
* workspace shares (#84)Dan Engelbrecht2024-05-293-3/+39
| | | 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.
* iobuffer memstomp fix (#85)Dan Engelbrecht2024-05-212-3/+14
| | | | | * Don't try to validate empty compact binary * Don't try to free fake memory buffer pointer in iobuffer destructor
* safer partial requests (#82)Dan Engelbrecht2024-05-171-34/+46
| | | | * fix partial cache miss logging * Handle zero size partial requests safer
* Correctly calculate memory view size from Mid/MidInline function if size is ↵Dan Engelbrecht2024-05-081-2/+8
| | | | not given (#76)
* assert improvements (#72)Dan Engelbrecht2024-05-034-33/+78
| | | | | - Improvement: Asserts gives an immediate ERROR log entry with callstack and reason - Improvement: Asserts flushes the log before sending error report to Sentry
* added logic to change default HTTP server implementation when running on ↵Stefan Boberg2024-05-022-0/+15
| | | | | | 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-022-62/+44
| | | | - 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
* miscellaneous minor bugfixes (#66)v5.5.0Stefan Boberg2024-04-261-4/+3
| | | | | | | | 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
* use direct file access for large file hash (#63)Dan Engelbrecht2024-04-269-55/+126
| | | - Improvement: Refactor `IoHash::HashBuffer` and `BLAKE3::HashBuffer` to not use memory mapped files. Performs better and saves ~10% of oplog export time on CI
* zenserverprocess hardening (#61)Dan Engelbrecht2024-04-251-0/+3
| | | | * 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/+17
| | | | | | | | | | | * 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-3/+9
| | | | * capture spawned server output and output on launch error * fix logging and launch validation in tests
* improved lock file handling (#50)Dan Engelbrecht2024-04-183-35/+95
| | | | | | | | | | | | - 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