Hi,

today my STAX-Job hanged up. This is the result of a thread query:

# staf local stax query job 14 thread 1
Response
--------
{
  Thread ID      : 1
  Parent TID     : <None>
  Start Date-Time: 20090730-16:04:03
  Call Stack     : [
    function: EMACH_main (Line: 804, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    sequence: 12/12 (Line: 865, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    block: main.Test execution (Line: 1076, File: /home/EMACH/EMACH-stax.xml, 
Machine: local://local)
    sequence: 1/1 (Line: 1077, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    finally (Line: 1154, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    try (Line: 1079, File: /home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 10/10 (Line: 1080, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    iterate: 1/1 {'Name': '2.1.1 CSTA_base_all', 'Tes... (Line: 1124, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 1/2 (Line: 1125, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    block: main.Test execution.2:1:1 CSTA_base_all (Line: 1127, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 3/4 (Line: 1128, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    function: EMACH_ProcessTestCases (Line: 1331, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 1/1 (Line: 1338, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    finally (Line: 1493, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    try (Line: 1340, File: /home/EMACH/EMACH-stax.xml, Machine: local://local)
    iterate: 1/1 {'Name': 'TC_1', 'SUT': 'PINGUIN', '... (Line: 1342, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 1/2 (Line: 1343, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    block: main.Test execution.2:1:1 CSTA_base_all.TC_1 / PINGUIN (Line: 1346, 
File: /home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 1/2 (Line: 1347, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    finally (Line: 1379, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    try (Line: 1348, File: /home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 5/5 (Line: 1349, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    function: EMACH_ProcessInteractions (Line: 1575, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    finally (Line: 1620, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    try (Line: 1582, File: /home/EMACH/EMACH-stax.xml, Machine: local://local)
    iterate: 1/2 {'Type': 'C', 'ExitPass': '0', 'Outp... (Line: 1583, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 1/3 (Line: 1584, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    if: Interaction['Type'] == 'F' (Line: 1586, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    function: EMACH_ProcessCaller (Line: 1781, File: 
/home/EMACH/EMACH-stax.xml, Machine: local://local)
    sequence: 1/2 (Line: 1787, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
    finally (Line: 1907, File: /home/EMACH/EMACH-stax.xml, Machine: 
local://local)
  ]
  Condition Stack: []
}


The part of the job included in the <finally> starting on line 1907 is:

      <finally>
        <if expr="MyProcessHandle != 0">
          <sequence>

            <log message="True">
              "        Interaction '%s': Signal '%s' sent due to User Abort" % \
              (Interaction['Name'], Interaction['AbortSignal']) </log>
            <log message="True">
              "        Waiting for signalled interaction to exit"</log>

            <script>
              while True :
                msg = EMACHTools.STAFsubmit2('LOCAL', 'PROCESS', \
                        'FREE HANDLE %s' % MyProcessHandle)
                if msg == None :
                  break
                RC = msg.split("RC=")[1]
                RC = int(RC.split(",")[0])
                if RC == 5 : # RC 5 is 'Handle does not exist'
                  break
                if RC != 12 : # RC 12 is 'Process Not Complete'
                  FatalMsg = msg
                  break
                time.sleep(0.1)
            </script>
            <call function="'EMACH_CheckError'"/>

            <log message="True">
              "        Signalled interaction is gone"</log>

          </sequence>
        </if>
      </finally>

The code is here to wait for a process termination after user has terminated a 
block.
I looked for the process the loop wait for, found it to be done and having a 
RC. So I
released the handle via staf, but that didn't make the job run.


# staf local process list
Response
--------
H# Command                       Start Date-Time   End Date-Time     RC
-- ----------------------------- ----------------- ----------------- ----------
38 /home/EMACH/EMACHRemoteHelper 20090727-21:02:12 20090728-13:57:26 129

# staf local process free handle 38
Response
--------

# staf local process list
Response
--------

#


Thinking about the call trace: why do I see <finally> as the innermost element? 
I would guess
the job is looping in <script>, but shouldn't <if> be the innermost then? When 
looking for
the jvm (ps command) I see its CPU-usage count as fast as real time.

Any help to find the problem is welcome.

Best Regards
Bodo







------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to