Kill a cache process

580 views
Skip to first unread message

desenv

unread,
Jun 26, 2010, 6:55:42 PM6/26/10
to intersystems...@googlegroups.com
Hi

Does anyone know how to kill a cache process ? I have tried $zutil
(4,pid) but it does not kill cache process but terminal and others
systems process.
My intention is to kill a process when the routine stops working due
to an external routine. Since I can collect a PID num on the start up,
it would be easy to kill it after find out when the systems freezes up
for a particular reason.

thank you all
mig

Sent from my iPhone

LeThanh Huong

unread,
Jun 27, 2010, 3:47:22 AM6/27/10
to intersystems...@googlegroups.com
Try to use the following instructions

set OK = 0
zn "%SYS"
set Job=##CLASS(SYS.Process).%OpenId(PID)
if (Job '= "")
{
set canBeKilled = Job.CanBeTerminated
if (canBeKilled)
{
set cpt = 0
while ((OK = 0) && (cpt <100)) //100 or 10, must try
{
set st = Job.ReleaseAllLocks()
set status = Job.Terminate()
if (status = 1) //if ($$$ISOK(status))
{set OK = 1}
else
{
HANG 1
set cpt = cpt + 1
}
}
}
}
k Job

--Huong


On 2010-06-27 00:55, desenv wrote:
> Hi
>
> Does anyone know how to kill a cache process ? I have tried

> $zutil(4,pid) but it does not kill cache process but terminal and

OldMster

unread,
Jun 30, 2010, 9:29:06 AM6/30/10
to Caché, Ensemble, DeepSee
If you are trying to kill a process that is hung after doing a
$ZF(-1,....., then trying to kill it at the Cache level will not work
- the external program is in control, so you will have to kill the
external process through the facilities provided by the operating
system you are running Cache on. However, this may leave Cache
unstable if it kills the Cache process in the course of terminating
the external process. If you have an external process that is
regularly hanging up, it should be fixed - killing it will eventually
destabilize Cache and lead to problems that are very difficult to
correct.
Mark
Reply all
Reply to author
Forward
0 new messages