Background Queues

Chris Kelleher

Administrator
Staff member
We just upgraded to Syteline 4.5, and we are having problems deleting jobs
off the background ques once they start running. I have a process out there
from the 4th - that is clearly not running anymore and I cannot delete it
because it is in Running Status. Has anyone out there had this problem, and
if so how did you get around it?

Thanks in advance.

Jennifer Olson
Semitool, Inc.
406-758-7529
 

Chris Kelleher

Administrator
Staff member
Yes I had the same problem.
The queue was showing active but nothing was happening.
I went into "system/Background queue setup" and unchecked the running box.

Randy

Randy Brazeau
Data Processing Co-Ordinator
Enduro-Niagara Ltd
 

Chris Kelleher

Administrator
Staff member
Fastest way is with 4gl progress.

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
FIND symix.batchrpt WHERE prog-name = "yourpath/prog" and queue =
"yourqueue" and stat = "R".
DELETE batchrpt.
END.
[/code]

Or more safely, you can shutdown all your queues, and run this in 4gl
Progress program.

<BLOCKQUOTE><font size="1" face="Arial, Verdana">code:</font><HR><pre>
FOR EACH symix.batchrpt WHERE stat = "R":
Stat = "H".
END.
[/code]

Then you can restart the background queue and go into Syteline, and delete
or restart any jobs you need.

I run a special routine like this, after I shutdown (or before I startup) my
queues every day, that resets the status on any jobs left with a status "R".

Lori Tamburlin
Pure Carbon Company
 

Chris Kelleher

Administrator
Staff member
I was working on this issue yesterday - the basic idea is to test and clean
up the queue environment before starting the new queue.

Let's review what the queue does:
1. We run batch/s-rpt.p in the background mode;
2. All batch/s-rpt.p does is to define aliases and start the real program -
batch/rpt.p;
3. batch/rpt.p checks the bglock.lock-flag - if flag is yes the program
exits - that is why you need to go manually to uncheck.
4. batch/rpt.p then go into a loop waiting for commands - it wakes up every
bglock.poll-freq seconds;
5. One of the commands, "shutdown", exits the loop.

When database is shut down by whatever means (procontrol, power falure,
etc.) the background process is terminated but the lock-flag is still on.

If there was a Job running at the time its batchrpt.stat is "R".

It seems obvious that the program should clear the flags before starting the
new queue except we do not want to start a second queue in case the previous
queue is still running!
That is the reason Symix wants us to manually ensure the queue is not
active.

That is nice and dandy but in the production environment we want the queue
to run automatically!

Solutions:
Some people insert the "Shutdown" command into the queue - this often
backfires when the system tech guy pushes this button too many times - the
multiple shutdown commands stop every new "start" command!

The hardest part is to determine whether the background queue is running.
On Unix it is easier but on NT one prowin32 command looks like any other.

There may be a way - I did not try it - to record Process Id and then check
if that process is running.

Unfortunately I do not have the source code for batch/rpt.p but it is easy
to modify/create your own batch/s-rpt.p.

I have set up a few things yesterday - for example if queue is locked I send
the Shutdown command and wait poll-freq to let existing queue die on its
own.

After that I reset the lock and remove any extraneous shutdown commands.
Also reset status "R" to "Q" - let it rerun.

It is now in testing and I am sure some changes will be made.
I would be interested in your input on all this.

Jake Kacher
 
Top