|
hiteksoftware.com User discussion forum
|
View previous topic :: View next topic |
Author |
Message |
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Sat Oct 21, 2006 7:43 am Post subject: how to determine when tasks finish using clm stop? |
|
|
user email support request:
This issue applies to the following situations:
Graceful server shutdown controlled by the server shutdown script.
Stopping production safely for e.g. some maintenance tasks, Automize upgrades, installations, etc
The problem is that I never know when and if the last task has finished.
If I run ‘clm.bat stop’ the script returns control after 55sec. regardless other settings (Maximum wait time before engine stops). The server shuts down then after 55 sec. while some tasks are still pending.
If I had for instance an ‘ActiveTasks’ option available by clm.bat which could return the number of pending tasks as ERRORLEVEL number I would be then able to know when the last task has finished.
The same information (i.e. the current number of pending tasks) displayed somewhere in GUI would be very helpful as well.
The expected behaviour after ‘clm.bat stop’ should be: Return control from the batch immediately after the last task has finished but no longer than ‘Maximum wait time before engine stops’. |
|
Back to top |
|
|
Robert Site Admin
Joined: 25 May 2006 Posts: 1140
|
Posted: Sat Oct 21, 2006 7:47 am Post subject: |
|
|
1) we have tested this to work correctly with clm stop. We had a 5 minute alarm task running. Then the clm stop command was sent. the engine shut down only after the alarm task finished.
Oct 21, 2006 7:50:36 AM Alarm - alarm - Manual Run
Oct 21, 2006 7:50:37 AM Alarm - alarm - Start Instance = 1086
Oct 21, 2006 7:50:46 AM Shutdown request received. Engine server port has been closed. Depending on settings, Engine may wait for running tasks to complete before shutdown. Instance = 322
Oct 21, 2006 7:50:46 AM Tasks running = [alarm]
Oct 21, 2006 7:55:38 AM Alarm - alarm - End Instance = 1086 , Exit Code = 0 , Runtime (ms) = 301062
Oct 21, 2006 7:55:46 AM No running tasks. Shutting down engine. Instance = 322
2) The only thing 'clm stop' can do is check if engine server is still running or if engine server stops running. When 'clm stop' is sent, the first thing the engine has to do is stop the server. Thats when 'clm stop' command returns since nothing can communicate with the engine from this point. The engine then waits silently for all running tasks to complete before shutting down.
i.e. there is no way for 'clm stop' command to wait for running tasks to complete before returning.
We have updated the response message as:
Shutdown request was received by engine. Engine server port has been closed. Depending on settings, Engine may wait for running tasks to complete before shutdown. Please check activity log.
The tasks running are listed in the log (see above):
Oct 21, 2006 7:50:46 AM Tasks running = [alarm] |
|
Back to top |
|
|
melvin Site Admin
Joined: 25 May 2006 Posts: 635 Location: Santa Barbara, california
|
Posted: Sat Oct 21, 2006 9:09 am Post subject: |
|
|
We have added the following variables to 7.16, which will help:
1) StoppedInstanceRunningTasks (updated periodically during maintainance task and shutdown requests, while engine is waiting for tasks to complete. Reset to 0 when engine shuts down)
2) StoppedInstanceKilledTasks (total running tasks when engine shuts down due to wait time expired)
3) CurrentInstanceRunningTasks (total running tasks in current instance of engine. Not reset to 0 if engine shuts down while tasks are running) |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|