[ 
https://issues.apache.org/jira/browse/OOZIE-3716?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17713808#comment-17713808
 ] 

halim kim commented on OOZIE-3716:
----------------------------------

[~dionusos]

Here is my example workflow(it is created by apache hue). I utilize simple 
hadoop wordcount jar file.
wordcount example counts the number of each word in the files of input 
directory and prints results in the output directory.

{code:xml}
<workflow-app name="Batch for query-java" xmlns="uri:oozie:workflow:0.5">
    <start to="java-0e67"/>
    <kill name="Kill">
        <message>Action failed, error 
message[${wf:errorMessage(wf:lastErrorNode())}]</message>
    </kill>
    <action name="java-0e67">
        <java>
            <job-tracker>${jobTracker}</job-tracker>
            <name-node>${nameNode}</name-node>
            <main-class>org.myorg.WordCount</main-class>
            <arg>hdfs://test/input</arg>
            <arg>hdfs://test/output</arg>
        </java>
        <ok to="End"/>
        <error to="Kill"/>
    </action>
    <end name="End"/>
</workflow-app>
{code}

and here is the result of oozie job. You can see 'Intercepting System.exit(0)' 
message but wordcount job was successful and  i was able to find result of 
wordcount job in the output directory.

{code:java}
>>> Invoking Main class now >>>

Launcher class: class org.apache.oozie.action.hadoop.JavaMain
INFO: loading log4j config file log4j.properties.
INFO: log4j config file log4j.properties loaded successfully.
{"properties":[{"key":"oozie.launcher.job.id","value":"0000021-230413183451249-oozie-oozi-W","isFinal":false,"resource":"programmatically"},{"key":"oozie.job.id","value":"0000021-230413183451249-oozie-oozi-W","isFinal":false,"resource":"programmatically"},{"key":"oozie.action.id","value":"0000021-230413183451249-oozie-oozi-W@java-0e67","isFinal":false,"resource":"programmatically"},{"key":"mapreduce.job.tags","value":"oozie-2a471a03ba6f13a3a475472233e0fcf0","isFinal":false,"resource":"programmatically"}]}Setting
 [tez.application.tags] tag: oozie-2a471a03ba6f13a3a475472233e0fcf0
Setting [spark.yarn.tags] tag: oozie-2a471a03ba6f13a3a475472233e0fcf0
Fetching child yarn jobs
tag id : oozie-2a471a03ba6f13a3a475472233e0fcf0
No child applications found
Java action main class        : org.myorg.WordCount
Java action arguments         :
             hdfs://test/input
             hdfs://test/output

Intercepting System.exit(0)

Oozie Launcher, uploading action data to HDFS sequence file: 
hdfs://test/oozie-oozi/0000021-230413183451249-oozie-oozi-W/java-0e67--java/action-data.seq
Stopping AM
Callback notification attempts left 0
Callback notification trying 
http://<OOZIE_HOST>:11000/oozie/callback?id=0000021-230413183451249-oozie-oozi-W@java-0e67&status=SUCCEEDED
Callback notification to 
http://<OOZIE_HOST>:11000/oozie/callback?id=0000021-230413183451249-oozie-oozi-W@java-0e67&status=SUCCEEDED
 succeeded
Callback notification succeeded
{code}


> Invocation of Main class completed Message is skipped when 
> LauncherSecurityManager calls system exit
> ----------------------------------------------------------------------------------------------------
>
>                 Key: OOZIE-3716
>                 URL: https://issues.apache.org/jira/browse/OOZIE-3716
>             Project: Oozie
>          Issue Type: Wish
>          Components: action
>    Affects Versions: 5.0.0, 5.1.0, 5.2.0, 5.3.0, 5.2.1
>            Reporter: halim kim
>            Assignee: halim kim
>            Priority: Minor
>
> When you execute oozie java action, there is no message like below if 
> LauncherSecurityManager throws an exceptions.
> {code:java}
> <<< Invocation of Main class completed <<<
> {code}
> However, if system exit code from LauncherSecurityManager is zero, it is 
> possible to consider main() method finished successfully.
> Therefore, there is no problem with printing "*<<< Invocation of Main class 
> completed <<<*" message in such cases.
> Oozie 4.x version prints the message in finally block but Oozie 5.x version 
> does not(There is Transition from LauncherMapper to LauncherAM class in oozie 
> 5.x version.)
> https://github.com/apache/oozie/blob/3d0843260199799be634dc330d98f1362536fcd5/sharelib/oozie/src/main/java/org/apache/oozie/action/hadoop/LauncherMapper.java#L232-L272
> This issue feels trivial but can cause a problem in hue editor.
> hue uses regular expression to distinguish whether oozie java action is 
> successfull or not. 
> https://github.com/cloudera/hue/blob/c0443438e9a29b9fbf22566022aeef27fc4c606b/desktop/libs/notebook/src/notebook/connectors/oozie_batch.py#L54
> The regular expression does not match if there is no "<<< Invocation of Main 
> class completed <<<" message so that hue considers oozie java action is not 
> completed even though main method of oozie java action is successful.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to