aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-12-02 14:08:08 +0100
committerGitHub Enterprise <[email protected]>2024-12-02 14:08:08 +0100
commit23d8341e3e43a81de777cccd81d1ae7494f26606 (patch)
treecf31bbd789e52645aa40200833e8c49c6e4c3776
parent5.5.15-pre1 (diff)
downloadzen-23d8341e3e43a81de777cccd81d1ae7494f26606.tar.xz
zen-23d8341e3e43a81de777cccd81d1ae7494f26606.zip
validate that root path exists for workspace before adding it (#250)
-rw-r--r--CHANGELOG.md1
-rw-r--r--src/zenstore/workspaces.cpp5
2 files changed, 6 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6e3751929..3076d20f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
- Bugfix: Fix returned content type when requesting a project store chunk with non-compressed accept type
- Bugfix: Fix path parsing using stale memory pointers when reading oplog index file UE-231759
- Bugfix: Ensure we don't throw exceptions from worker threads when doing oplog upload/download operations
+- Bugfix: Don't add workspace to config.json if the provided file system path does not exist
- Improvement: Increase the smallest chunk size in block store to do batch reading for
- Improvement: Block compact of oplogs from performance sensitive calls
diff --git a/src/zenstore/workspaces.cpp b/src/zenstore/workspaces.cpp
index be921552a..80e03296c 100644
--- a/src/zenstore/workspaces.cpp
+++ b/src/zenstore/workspaces.cpp
@@ -902,6 +902,11 @@ Workspaces::AddWorkspace(const LoggerRef& Log, const std::filesystem::path& Work
{
throw std::invalid_argument(fmt::format("invalid root path '{}' for workspace {}", Configuration.RootPath, Configuration.Id));
}
+ if (!std::filesystem::is_directory(Configuration.RootPath))
+ {
+ throw std::invalid_argument(
+ fmt::format("workspace root path '{}' does not exist for workspace '{}'", Configuration.RootPath, Configuration.Id));
+ }
std::string Error;
std::vector<WorkspaceConfiguration> WorkspaceConfigurations = ReadConfig(Log, WorkspaceStatePath, Error);
if (!Error.empty())