summaryrefslogtreecommitdiffstats
path: root/searchcore
diff options
context:
space:
mode:
authorArne H Juul <arnej27959@users.noreply.github.com>2022-06-21 16:40:55 +0200
committerGitHub <noreply@github.com>2022-06-21 16:40:55 +0200
commit240b67fcb1ab9c8d39082d1d0c62a72af9503480 (patch)
tree955e15f2ba0b17a961011fd0353cb7c4f1901442 /searchcore
parent550a08b9320098f473b44606e424ab07684a364f (diff)
parent9d87affce8ca7ec4bd288e68fbab6b401a92ede8 (diff)
Merge pull request #23179 from vespa-engine/arnej/probe-disk
probe base directory
Diffstat (limited to 'searchcore')
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/proton.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
index ff5924fa6bc..c4b30d50dbd 100644
--- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp
@@ -149,8 +149,18 @@ const vespalib::string CUSTOM_COMPONENT_API_PATH = "/state/v1/custom/component";
VESPA_THREAD_STACK_TAG(proton_initialize_executor)
VESPA_THREAD_STACK_TAG(proton_close_executor)
+void ensureWritableDir(const vespalib::string &dirName) {
+ auto filename = dirName + "/tmp.filesystem.probe";
+ vespalib::File probe(filename);
+ probe.unlink();
+ probe.open(vespalib::File::CREATE);
+ probe.write("probe\n", 6, 0);
+ probe.close();
+ probe.unlink();
}
+} // namespace <unnamed>
+
Proton::ProtonFileHeaderContext::ProtonFileHeaderContext(const vespalib::string &creator)
: _hostName(),
_creator(creator),
@@ -278,6 +288,7 @@ Proton::init(const BootstrapConfig::SP & configSnapshot)
{
assert( _initStarted && ! _initComplete );
const ProtonConfig &protonConfig = configSnapshot->getProtonConfig();
+ ensureWritableDir(protonConfig.basedir);
const HwInfo & hwInfo = configSnapshot->getHwInfo();
_hw_info = hwInfo;