You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@asterixdb.apache.org by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org> on 2016/10/04 03:58:00 UTC
Change in asterixdb[master]: remove ini file on abnormal termination
Till Westmann has uploaded a new change for review.
https://asterix-gerrit.ics.uci.edu/1249
Change subject: remove ini file on abnormal termination
......................................................................
remove ini file on abnormal termination
Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
---
M hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
1 file changed, 19 insertions(+), 6 deletions(-)
git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/49/1249/1
diff --git a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
index 848bdd2..67f55f3 100644
--- a/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
+++ b/hyracks-fullstack/hyracks/hyracks-control/hyracks-nc-service/src/main/java/org/apache/hyracks/control/nc/service/NCService.java
@@ -72,7 +72,7 @@
*/
private static Process proc = null;
- private static List<String> buildCommand() throws IOException {
+ private static List<String> buildCommand(File tempIni) throws IOException {
List<String> cList = new ArrayList<>();
// Find the command to run. For now, we allow overriding the name, but
@@ -91,9 +91,6 @@
}
cList.add("-config-file");
- // Store the Ini file from the CC locally so NCConfig can read it.
- File tempIni = File.createTempFile("ncconf", ".conf");
- tempIni.deleteOnExit();
ini.store(tempIni);
cList.add(tempIni.getCanonicalPath());
@@ -126,9 +123,11 @@
* prevented the process from being launched or the process returned
* a non-0 (abnormal) exit code.
*/
- private static boolean launchNCProcess() {
+ private static boolean launchNCProcess() throws IOException {
+ // Store the Ini file from the CC locally so NCConfig can read it.
+ File tempIni = File.createTempFile("ncconf", ".conf");
try {
- ProcessBuilder pb = new ProcessBuilder(buildCommand());
+ ProcessBuilder pb = new ProcessBuilder(buildCommand(tempIni));
configEnvironment(pb.environment());
// QQQ inheriting probably isn't right
pb.inheritIO();
@@ -163,6 +162,7 @@
try {
retval = proc.waitFor();
waiting = false;
+ tempIni = delete(tempIni);
} catch (InterruptedException ignored) {
}
}
@@ -177,9 +177,22 @@
LOGGER.log(Level.SEVERE, "Configuration from CC broken", e);
}
return false;
+ } finally {
+ delete(tempIni);
}
}
+ static private File delete(File tmpFile) {
+ if (tmpFile == null) {
+ return null;
+ }
+ if (!tmpFile.delete()) {
+ LOGGER.warning(tmpFile.toString() + "not deleted");
+ return tmpFile;
+ }
+ return null;
+ }
+
private static boolean acceptConnection(InputStream is) {
// Simple on-wire protocol:
// magic cookie (string)
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: remove ini file on abnormal termination
......................................................................
Patch Set 1:
Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/839/
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: remove ini file on abnormal termination
......................................................................
Patch Set 1:
Build Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-notopic/2905/
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-HasComments: No
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: remove ini file on abnormal termination
......................................................................
Patch Set 1: Integration-Tests-1
Integration Tests Failed
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/835/ : UNSTABLE
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org>.
Till Westmann has abandoned this change.
Change subject: remove ini file on abnormal termination
......................................................................
Abandoned
No improvement
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: abandon
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: remove ini file on abnormal termination
......................................................................
Patch Set 1: Integration-Tests+1
Integration Tests Successful
https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/839/ : SUCCESS
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Jenkins (Code Review)" <do...@asterixdb.incubator.apache.org>.
Jenkins has posted comments on this change.
Change subject: remove ini file on abnormal termination
......................................................................
Patch Set 1:
Integration Tests Started https://asterix-jenkins.ics.uci.edu/job/asterix-gerrit-integration-tests/835/
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-HasComments: No
Change in asterixdb[master]: remove ini file on abnormal termination
Posted by "Till Westmann (Code Review)" <do...@asterixdb.incubator.apache.org>.
Till Westmann has posted comments on this change.
Change subject: remove ini file on abnormal termination
......................................................................
Patch Set 1:
TRIGGER: asterix-gerrit-integration-tests
--
To view, visit https://asterix-gerrit.ics.uci.edu/1249
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I963825969bbe9e6e1ce686222b42d6e0f5769d28
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Till Westmann <ti...@apache.org>
Gerrit-Reviewer: Jenkins <je...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: No