segunda-feira, 2 de janeiro de 2012

what to do with hanging work process

Work Process Status

Work Process are needed to handle tasks in ABAP instances. In case of an SAP Application Server without available work process no much is possible and the applicaiton server cannot be used.
For this reason the Dispatcher and Taskhandler component are responsible for the work process behavior in the SAP Application Server ABAP.
They are responsible for the main executable disp+work them the lifecycle of workprocesses.

Sometime the work process can hangs, for distinct reason like a bug, error condition, remote execution or fail in the execution.
To check the work process status you can use some ways:

1) From R3 side with transaction SM50 or SM66;

2) From Operating System side with dpmon:
"dpmon pf=<instance profile> l"

3) From Operating System side with sapcontrol:
"sapcontrol -nr <instance number> ABAPGetWPTable"


Identifying an hanging work process

You do find an hanging work process if it is doing nothing for a long time, as you can see in the figure 1. I such way the time may be find in the "Time" column of work process table status. The work process is "Running" for a long time in the same report, this process probably is an hanging Work Process.

Figure 1. Work Process status in SM50

Back it to normal

You can try to cancel the Work Process in some ways:

1) Go to transaction SM50
- select the work process
- click in Process
- Cancel with/without Core

2) Kill it from Operating System side:
"kill -2 <PID> "
"kill -9 <PID> " (critial way)

Root Cause Analysis

The correct way to find out the root cause of the issue is getting further information with the Work Process trace file.
What must be performed in that situation:

1) Save screenshots of the Work Process table status;

2) Increase the work process trace level to get the C-stack from Operating System side:
"kill -USR2 <PID> " or
"sapntkill -USR2 <PID> " (for Windows environment)
The C-stack is the main important because it will be writen in the work process trace file and you do find the called kernel functions when the work process stopped/hangs, with the C-stack is possible to find the component responsible for the situation.

3) If possible, try to reproduce the error increasing the trace to a high trace level. In such way is possible to understand what was happening before the work process got the hanged situation. So, try to idenfity the steps to reproduce the issue.


Others causes

1) Specific reason

The Work Process can hangs for some specific reason that is find in the "Reason" column of Work Process Table Status. These are special conditions and the analysis should be as per the reason.
The figure 2 show an example of hanging work process for RFC reason.

Figure 2. Transaction SM50

The possible reasons are:
1. Session waits for debugger input
2. Session waits for RFC response
3. Session waits for enqueue response
4. Session waits for update response
5. Session waits for spool
6. Session waits for adm message response
7. Session waits for number range buffer response
8. Session waits for gui input
9. Session is hold because of private memory
10. Session waits for update admin message response
11. Session reads the server list
12. Session waits for gateway monitor response
13. Session waits for return of blocking snc call
14. Session is locked for a dedicated user
15. Session sleeps
16. Session waits for a message to be send
17. Session waits for execution of an operation system command
18. Session waits for execution of an msg server action
19. Session waits for ARFC execution
20. Session waits for response of an remote action
22. Session waits for update 2 response


2) A semaphore

The semaphores are another reason for the hanging situation. You do find this situation in the "Sem" column. For example the figure 3.

Figure 3. Work Process with semaphore

The reasons for the semaphores are in the SAP note 33873.

1: PXA-Semaphore (ABAP program buffer)
2: WP_CA_ADM-Semaphore (workprocess/dispatcher communication )
3: APPC_CA_ADM-Semaphore (workprocess/gateway(gwrd) communication)
4: TM_ADM-Semaphore (workprocess/dispatcher communication )
5: COMM_ADM-Semaphore (workprocess/dispatcher communication )
6: ROLL_ADM-Semaphore (roll administration)
7: PAGING-Semaphore (paging administration)
8: NO_BUFFER-Semaphore (number range buffer)
9: STAT-Semaphore (statistics buffer)
10: GW_REQ_IND-Semaphore (gateway request)
11: CALI_BUFFER-Semaphore (calendar buffer)
12: CCC-Semaphore (character conversion buffer)
13: Verbucher-Semaphore (update startup)
14: PRES_BUF-Semaphore (presentation buffer)
15: SHM_ADM_AREA-Semaphore (shared memory administration)
16: DB_TBUFF-Semaphore (DB generic key table buffer)
17: DB_SYNC-Semaphore (DB buffer syncronization)
18: DB_TTAB-Semaphore (DB nametab buffer)
19: DB_SNTAB-Semaphore (DB nametab buffer)
20: DB_IREC-Semaphore (DB nametab buffer)
21: DB_FTAB-Semaphore (DB nametab buffer)
22: LOGFILE-Semaphore (batch input logfile)
23: REQ_QUEUE-Semaphore (dispatcher request queue)
24: DB_TBUFF_P-Semaphore (DB single key table buffer)
25: ENQ_REQ-Semaphore (enqueue request/local server)
26: ENQ-TABLE-Semaphore (enqueue table)
27: SAPCOMM_1-Semaphore (sap-comm)
28: SAPCOMM_2-Semaphore (sap-comm)
29: FIXADR-Semaphore (VMS fix addresses)
30: DB_CUA_BUFFER-Semaphore (CUA(=Menu) buffer)
31: RSPO_ADMIN-Semaphore (spool administration)
32: EM_ADM-Semaphore (memory management, extended memory admin)
33: ES-Semaphore (memory management, extended segm. admin)
34: MSBUF-Semaphore (messageserver buffer)
35: SEM_DB_OBJ_BUFFER (Export/Import buffer)
36: SEM_ES_USER_KEY (Estended Segments User Lis )
37: SEM_SEM2MTX_KEY (global mutex for sem2 / mt )
38: SEM_CCMS_AS_MONI_KEY (CCMS monitoring for appl.s)
39: SEM_EG_ADM (Extended Global Memory )
40: SEM_TEST_1 (reserved for test programs)
41: SEM_TEST_2 (reserved for test programs)
42: SEM_STAT_BUF (shared statistic buffer)
43: SEM_RSPO_CACHE (rspo cache)
44: SEM_AUDIT_SHM (basis audit shm protectio )
45: SEM_ASTAT_KEY (application statistics bu )
46: SEM_PROFILE___DUMMY (profile parameter buf)
47: SEM_RSPO_RFC-Semaphore (spool async rfc calls)
48: SEM_ENQID_KEY (EnqId )
49: SEM_PRIVATE_KEY_MAX (maximum private key number)
50: SEM_THRUN_ADM (taskhandler runtime)
51: SEM_ATRA_KEY (protect atra memory)
52: SEM_MPI_ADM (memory pipes adm. (MPI))
53: SEM_COV_KEY (shbuf of coverage analyzer)
54: SEM_ZDATE_TIMEINFO (WP-independ. time sync info)
55: SEM_DB_OTR_BUFFER (Online Text Repository Buf.)
56: SEM_DB_ESM_BUFFER (Export/Import Memory)
57: SEM_RTM_KEY (shbuf of runtime monitor)
58: SEM_JAVA_1 (sem 1 for java)
59: SEM_ABAP_SHO (ABAP shared objects)
60: SEM_JCONTROL_ADMIN (JControl Administration)

Nenhum comentário:

Postar um comentário