Friday, August 18, 2006

‘Killing’ CICS tasks with CICS Performance Monitor

A question often asked is, “What capabilities exist to ‘kill’ a taskfrom a given CICS system via CICS Performance Manager?”. (Herewe are using the term ‘kill’ to refer to the action provided by manyperformance management monitors.)
CICS Performance Monitor bases its facilities on those of CICSPlexSystem Manager. CICSPlex SM itself is an EXEC CICS application,and therefore provides the ability to PURGE and FORCEPURGEtasks. Those facilities are exploited by CICS PM.Killing a task in a CICS region can have catastrophic consequences;for instance, no data integrity is guaranteed. As an example, considerthe consequences of purging a task in a DB2WAIT condition.Having killed the task, the DB2 subsystem could subsequently postan ECB in the CICS system where the storage is no longer therequestor’s ECB. This could have disastrous results.
Nevertheless, the customer may deem this risk acceptable. Whilstthis is a concern to CICS system programmers or operators, thisfunction is used in the scenario where a region would have to bebrought down anyway to resolve the problem, and killing the taskwill allow the region to continue processing critical work for sometime. An example would be resolving a problem in a tradingorganization just before the market closes.
The problem is actually subtler than this, and can be broken downinto the following items:

Which system is the problem in?

Which task do I want to kill?

How do I kill it?

So, we need to know which task to kill before we can kill it.
In order to understand this topic, some appreciation is required ofthe underlying architecture of CICSPlex SM (upon which CICS PMis built), along with a classification of types of work running withinthe CICS system, and the CICS system’s current state.
CICSPLEX SM AGENT ARCHITECTURECICSPlex SM (CPSM) provides single system image managementthrough a network of CICS Managing Address Spaces (CMASs).These CMASs communicate with CPSM agents running in thetarget CICS regions. For example, these agents are responsible forINQUIREing and SETting the attributes of CICS resources.
Communication from the CMAS to the CPSM agent is achievedthrough a communications agent, also running in the CICS region,which mediates requests from the CMAS. Communication with thisagent is via MVS cross-memory services (not CICS communicationservices).
The communications agent, query, and set agents, along with otherCPSM infrastructure services, are initialized at CICS initializationvia PLT processing. This establishes long-running tasks that,essentially, process requests for the lifetime of the CICS region.These resources run on the QR TCB. This does expose them to thepossibility of being blocked because looping tasks dominate the QRTCB, or delayed through resource shortage (eg storage).
CICS WORKLOAD TYPESCICS workloads can be classified into various types for the purposesof this discussion as follows:

Normally executing tasks – the vast majority of CICS tasks. These are susceptible to a CEMT PURGE TASK command.

Looping tasks – these are tasks that can be looping within themselves (and therefore susceptible to CICS runaway task detection process, ICVR process). They are looping through the CICS exec layer issuing EXEC CICS commands.

Tasks in a purgable wait – these are susceptible to a CEMT FORCEPURGE TASK command.

Tasks in a non-purgable wait (eg a DB2WAIT) – these are not susceptible to a CEMT FORCEPURGE command, but are susceptible to a kill command. It should be noted that the number of situations in which tasks are placed into a nonpurgable wait has reduced with each CICS release. For example, dispatcher and DB2 changes in CICS TS 2.2 have resulted in the ability to purge tasks in a DB2WAIT state without the need for kill.

CICS STATEThe state of the CICS system can also play a role in being able to killa task. If the system is at maxtask or is short on storage, then a newtask (such as CEMT) cannot be dispatched. This is an instancewhere CPSM’s long-running task architecture will be able to issuethe appropriate command, whilst base CEMT would not.The scenarios are summarized in Figure 1.