Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: connect abort and improve log #3809

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public OpenmldbTable(String dbName, String tableName, SdkOption option, String w
// no need to check table exists, schema() will check it later
} catch (SqlException e) {
e.printStackTrace();
throw new RuntimeException("connect to openmldb failed", e); // abort immediately
}
// TODO: cache schema & delete executor?
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ private void init() throws ConfigException {
}

// Get properties and check
// server.host will be used by RunBatchSql, it's not good to be null
if (props.getProperty("server.host") == null) {
props.setProperty("server.host", "0.0.0.0");
}
Expand Down Expand Up @@ -357,14 +358,13 @@ private void init() throws ConfigException {
}
}

String SPARK_HOME = firstNonEmpty(props.getProperty("spark.home"), System.getenv("SPARK_HOME"));
String SPARK_HOME = firstNonEmpty(props.getProperty("spark.home"));
// isEmpty checks null and empty
if (isEmpty(SPARK_HOME)) {
throw new ConfigException("spark.home", "should set config 'spark.home' or environment variable 'SPARK_HOME'");
}
if (SPARK_HOME != null) {
props.setProperty("spark.home", SPARK_HOME);
}
// rewrite env for spark submit
props.setProperty("spark.home", SPARK_HOME);

// TODO: Check if we can get spark-submit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public static void main(String[] args) {
server.start();
} catch (Exception e) {
e.printStackTrace();
logger.error(String.format("Fail to start TaskManager, message: ", e.getMessage()));
logger.error("Fail to start TaskManager", e);
}
}

Expand Down
Loading