Commit 17cc003f authored by legoc's avatar legoc
Browse files

Removed useless and confusing test application.hasToBeKilled() in...

Removed useless and confusing test application.hasToBeKilled() in LifecycleApplicationThread.onTermination() when processing exit value: In some cases the error was not propagated
parent 5b6a58d4
......@@ -6,14 +6,14 @@
<version>0.0.1</version>
</parent>
<artifactId>cameo-server-jzmq</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>fr.ill.ics</groupId>
<artifactId>cameo-server</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<exclusions>
<exclusion>
<groupId>fr.ill.ics</groupId>
......
1.0.2
-----
* Removed useless and confusing test "application.hasToBeKilled()" in LifecycleApplicationThread.onTermination() when processing exit value: In some cases the error was not propagated.
1.0.1
-----
......
......@@ -6,7 +6,7 @@
<version>0.0.1</version>
</parent>
<artifactId>cameo-server</artifactId>
<version>1.0.1</version>
<version>1.0.2</version>
<packaging>jar</packaging>
<properties>
......
......@@ -87,9 +87,12 @@ public class LifecycleApplicationThread extends ApplicationThread {
// Get result of the last execution.
try {
exitValue = application.getProcess().waitFor();
// Pass result to error callback.
if (exitValue != 0 && !application.hasToBeKilled()) {
// An exit value different from 0 indicates the process terminated with an error.
// If the cameo app was killed i.e. destroyForcibly() was called (ManagedApplication.kill() or UnmanagedApplication.kill()) the exit value is 0.
// Thus we do not have to filter these cases.
// However for a manual kill using a system call, the exit value is not 0 but we can consider as an error.
if (exitValue != 0) {
Log.logger().info("Application " + application.getNameId() + " returned error code " + exitValue);
// Execute the error callback.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment