Skip to content

Commit

Permalink
#483 rollback exit_on_job_init_fail逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
kfchu committed Sep 20, 2018
1 parent 9cb790c commit 70167ba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.concurrent.*;

import static com.vip.saturn.job.executor.SaturnExecutorService.WAIT_JOBCLASS_ADDED_COUNT;
import static com.vip.saturn.job.utils.SystemEnvProperties.VIP_SATURN_EXIT_ON_JOB_INIT_FAIL;

/**
* @author hebelala
Expand Down Expand Up @@ -181,10 +180,6 @@ private boolean initJobScheduler(String jobName) {
} catch (JobInitAlarmException e) {
// no need to log exception stack as it should be logged in the original happen place
raiseAlarmForJobInitFailed(jobName, e);
if (VIP_SATURN_EXIT_ON_JOB_INIT_FAIL) {
log.error(SaturnConstant.LOG_FORMAT, jobName, "job init fail and JVM is going to exit!!");
System.exit(-1);
}
} catch (Throwable t) {
log.warn(String.format(SaturnConstant.LOG_FORMAT_FOR_STRING, jobName,
"job initialize failed, but will not stop the init process"), t);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ public class SystemEnvProperties {
public static int VIP_SATURN_SESSION_TIMEOUT_IN_SECONDS_IN_UNSTABLE_NETWORK = 40;
public static int VIP_SATURN_CONNECTION_TIMEOUT_IN_SECONDS_IN_UNSTABLE_NETWORK = 40;
public static int VIP_SATURN_RETRY_TIMES_IN_UNSTABLE_NETWORK = 9;
// exit when job init fail
public static boolean VIP_SATURN_EXIT_ON_JOB_INIT_FAIL = false;
private static final String NAME_VIP_SATURN_EXIT_ON_JOB_INIT_FAIL = "VIP_SATURN_EXIT_ON_JOB_INIT_FAIL";

static {
loadProperties();
Expand Down Expand Up @@ -199,12 +196,6 @@ public static void loadProperties() {
log.error("msg=" + t.getMessage(), t);
}
}

String isExitOnJobInitFail = System.getProperty(NAME_VIP_SATURN_EXIT_ON_JOB_INIT_FAIL,
System.getenv(NAME_VIP_SATURN_EXIT_ON_JOB_INIT_FAIL));
if (!Strings.isNullOrEmpty(isExitOnJobInitFail)) {
VIP_SATURN_EXIT_ON_JOB_INIT_FAIL = Boolean.parseBoolean(isExitOnJobInitFail);
}
}

protected static String trim(String property) {
Expand Down

0 comments on commit 70167ba

Please sign in to comment.