You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2018/02/07 03:36:37 UTC
kudu git commit: Fix crash when log_dir is not specified
Repository: kudu
Updated Branches:
refs/heads/master 1c8c0ad12 -> c5b2002e6
Fix crash when log_dir is not specified
This fixes the tpch1 benchmark after the recent enabling of metrics
logging. The crash was due to FLAGS_log_dir being unset. In typical
servers, we rely on InitGoogleLoggingSafe to default log_dir to /tmp,
but our tpch1 benchmark embeds a client, and a constructor function in
the client calls InitGoogleLoggingSafeBasic which doesn't do this
defaulting. So, we ended up starting the minicluster with an empty log
dir.
This patch just makes it not start the metrics logger if no log dir is
set.
Change-Id: I725a7da038913ff05227c6d5555c34167138148b
Reviewed-on: http://gerrit.cloudera.org:8080/9233
Reviewed-by: Jean-Daniel Cryans <jd...@apache.org>
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <mp...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/c5b2002e
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/c5b2002e
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/c5b2002e
Branch: refs/heads/master
Commit: c5b2002e62b630fe320b637c6e6649a67446136e
Parents: 1c8c0ad
Author: Todd Lipcon <to...@apache.org>
Authored: Tue Feb 6 15:53:54 2018 -0800
Committer: Mike Percy <mp...@apache.org>
Committed: Wed Feb 7 03:36:22 2018 +0000
----------------------------------------------------------------------
src/kudu/server/server_base.cc | 4 ++++
1 file changed, 4 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/kudu/blob/c5b2002e/src/kudu/server/server_base.cc
----------------------------------------------------------------------
diff --git a/src/kudu/server/server_base.cc b/src/kudu/server/server_base.cc
index 95d3e65..5d63cdd 100644
--- a/src/kudu/server/server_base.cc
+++ b/src/kudu/server/server_base.cc
@@ -601,6 +601,10 @@ Status ServerBase::StartMetricsLogging() {
if (options_.metrics_log_interval_ms <= 0) {
return Status::OK();
}
+ if (FLAGS_log_dir.empty()) {
+ LOG(INFO) << "Not starting metrics log since no log directory was specified.";
+ return Status::OK();
+ }
return Thread::Create("server", "metrics-logger", &ServerBase::MetricsLoggingThread,
this, &metrics_logging_thread_);