Skip to content
Permalink
Browse files

Merge branch '3.9' of https://github.com/JumpMind/symmetric-ds.git in…

…to 3.9
  • Loading branch information...
erilong committed Aug 8, 2019
2 parents 8d6d476 + 7e2bdb2 commit 5abdf4a2eaf4240a31035324f1eec4825bd719fa
@@ -47,7 +47,7 @@
*/
public interface IDataService {

public void insertTableReloadRequest(TableReloadRequest request);
public void insertTableReloadRequest(ISqlTransaction transaction, TableReloadRequest request);

public TableReloadRequest getTableReloadRequest(TableReloadRequestKey key);

@@ -236,15 +236,15 @@ protected void deleteTableReloadRequest(ISqlTransaction sqlTransaction,
Types.VARCHAR, Types.VARCHAR, Types.VARCHAR });
}

public void insertTableReloadRequest(TableReloadRequest request) {
public void insertTableReloadRequest(ISqlTransaction transaction, TableReloadRequest request) {
Date time = new Date();
request.setLastUpdateTime(time);
if (request.getCreateTime() == null) {
request.setCreateTime(time);
}
request.setCreateTime(new Date((request.getCreateTime().getTime() / 1000) * 1000));

sqlTemplate.update(
transaction.prepareAndExecute(
getSql("insertTableReloadRequest"),
new Object[] { request.getReloadSelect(), request.getBeforeCustomSql(),
request.getCreateTime(), request.getLastUpdateBy(),
@@ -206,6 +206,26 @@ protected void execJava(boolean isConsole) {
restartDetected = false;
startProcess = true;
} else if (keepRunning) {
long tenminutesinms = 60 * 10 * 1000;
long twelveminutesinms = 60 * 12 * 1000;
long tensecondsinms = 10 * 1000;
long now = System.currentTimeMillis();
while(child.isAlive()) {
logger.log(Level.WARNING, "Server process has not stopped yet");
if(System.currentTimeMillis() - now > twelveminutesinms) {
logger.log(Level.SEVERE, "Server process never exited, exiting now");
child.destroyForcibly();
// If it has not exited by now, it probably never will.
break;
}
if(System.currentTimeMillis() - now > tenminutesinms) {
logger.log(Level.SEVERE, "Server process never exited, trying to force the exit of server process");
child.destroyForcibly();
}
try {
Thread.sleep(tensecondsinms);
} catch(InterruptedException e) { }
}
logger.log(Level.SEVERE, "Unexpected exit from server: " + child.exitValue());
long runTime = System.currentTimeMillis() - startTime;
if (System.currentTimeMillis() - startTime < 7000) {
@@ -225,7 +245,7 @@ protected void execJava(boolean isConsole) {
updateStatus(Status.STOPPED);
throw new WrapperException(Constants.RC_SERVER_EXITED, child.exitValue(), "Exception caught.");
} catch (Throwable ex2) {
ex.printStackTrace();
ex2.printStackTrace();
}
}
}

0 comments on commit 5abdf4a

Please sign in to comment.
You can’t perform that action at this time.