hiteksoftware.com Forum Index hiteksoftware.com
User discussion forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

how to determine when tasks finish using clm stop?

 
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Scheduler
View previous topic :: View next topic  
Author Message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Sat Oct 21, 2006 7:43 am    Post subject: how to determine when tasks finish using clm stop? Reply with quote

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
View user's profile Send private message
Robert
Site Admin


Joined: 25 May 2006
Posts: 1140

PostPosted: Sat Oct 21, 2006 7:47 am    Post subject: Reply with quote

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
View user's profile Send private message
melvin
Site Admin


Joined: 25 May 2006
Posts: 635
Location: Santa Barbara, california

PostPosted: Sat Oct 21, 2006 9:09 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    hiteksoftware.com Forum Index -> Scheduler All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
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