[ 
https://issues.apache.org/jira/browse/OOZIE-1939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Azrael updated OOZIE-1939:
--------------------------

    Attachment: OOZIE-1939.1.patch

[~rohini] Because of ThreadLocal, I added {{setLogInfo()}} at XCommand.
If the logInfo in {{setLogInfo()}} is enough, It might not need to set logInfo 
in {{loadState()}}.
It is more convenient to implement after OOZIE-1918.
{code}
public final T call() throws CommandException {
    setLogInfo();
    LOG = XLog.resetPrefix(LOG);
    ...
    loadState();
}
{code}

After apply patch, jobId in log statement (such as Acquiring lock , Execute 
command) is correct. 
{code}
2014-07-26 23:20:00,011 DEBUG CoordActionInputCheckXCommand:547 
[pool-2-thread-1] - USER[-] GROUP[-] TOKEN[-] APP[-] JOB[-] ACTION[-] Acquired 
lock for [0000000-140726231819522-oozie-seoe-C] in [coord_action_input]
2014-07-26 23:20:00,015 DEBUG CoordActionInputCheckXCommand:547 
[pool-2-thread-1] - USER[-] GROUP[-] TOKEN[-] APP[-] 
JOB[0000000-140726231819522-oozie-seoe-C] 
ACTION[0000000-140726231819522-oozie-seoe-C@2] Execute command 
[coord_action_input] key [0000000-140726231819522-oozie-seoe-C]

2014-07-26 16:53:26,765 DEBUG CoordActionInputCheckXCommand:547 
[pool-2-thread-1] - USER[seoeun] GROUP[user] TOKEN[] APP[test] 
JOB[0000001-140726165314153-oozie-seoe-W] 
ACTION[0000001-140726165314153-oozie-seoe-W@:start:] Acquired lock for 
[0000000-140726165314153-oozie-seoe-C] in [coord_action_input]
{code}

However, {{CoordActionUpdateXCommand}} use WF jobId for logInfo, log message is 
as following: 
{code}
2014-07-26 23:40:40,004 DEBUG CoordActionUpdateXCommand:547 [pool-2-thread-1] - 
USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000001-140726233734667-oozie-seoe-W] 
ACTION[] Acquired lock for [0000000-140726233734667-oozie-seoe-C] in 
[coord-action-update]
2014-07-26 23:40:40,022 DEBUG CoordActionUpdateXCommand:547 [pool-2-thread-1] - 
USER[-] GROUP[-] TOKEN[-] APP[-] JOB[0000000-140726233734667-oozie-seoe-C] 
ACTION[0000000-140726233734667-oozie-seoe-C@1] Execute command 
[coord-action-update] key [0000000-140726233734667-oozie-seoe-C]
{code}

> Incorrect job information is set while logging
> ----------------------------------------------
>
>                 Key: OOZIE-1939
>                 URL: https://issues.apache.org/jira/browse/OOZIE-1939
>             Project: Oozie
>          Issue Type: Bug
>            Reporter: Purshotam Shah
>            Assignee: Azrael
>         Attachments: OOZIE-1939.1.patch
>
>
> {code}
> 2014-07-16 17:28:06,422 DEBUG CoordChangeXCommand:545 [http-0.0.0.0-4443-5] - 
> USER[hadoopqa] GROUP[users] TOKEN[] APP[coordB236] 
> JOB[0011514-140716042555-oozie-oozi-C] ACTION[-] Acquired lock for 
> [0011385-140716042555-oozie-oozi-C] in [coord_change]
> 2014-07-16 17:28:06,422 TRACE CoordChangeXCommand:548 [http-0.0.0.0-4443-5] - 
> USER[hadoopqa] GROUP[users] TOKEN[] APP[coordB236] 
> JOB[0011514-140716042555-oozie-oozi-C] ACTION[-] Load state for 
> [0011385-140716042555-oozie-oozi-C]
> {code}
> {code}
>     protected void loadState() throws CommandException {
>         jpaService = Services.get().get(JPAService.class);
>         if (jpaService == null) {
>             LOG.error(ErrorCode.E0610);
>         }
>         try {
>             coordJob = 
> CoordJobQueryExecutor.getInstance().get(CoordJobQuery.GET_COORD_JOB_MATERIALIZE,
>  jobId);
>             prevStatus = coordJob.getStatus();
>         }
>         catch (JPAExecutorException jex) {
>             throw new CommandException(jex);
>         }
>         // calculate start materialize and end materialize time
>         calcMatdTime();
>         LogUtils.setLogInfo(coordJob, logInfo);
>     }
> {code}
> Most of the commands set jobinfo after loadstate, because of that few log 
> statements ( like acquiring lock, load state) logs with previous jobinfo. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to