2 Replies Latest reply on Oct 15, 2011 1:17 AM by Tim Webb

    Task hanging at Suspending

    Tom Rendon

      We have a task set up to convert drawings to PDF on a state transistion.  About a week ago, I was having trouble with one of the tasks executing, so I was going to suspend the task and then restart it.  The task has been stuck suspending since then.  How do I clear this task or reset this task?


      I saw this discussion, but did not know if it would apply since it was talking about cancelling. link


      If it does apply, do I look for the same TaskStatus value in the SQL server?


      Thanks in advance. 

        • Re: Task hanging at Suspending
          Tom Rendon

          Found it!!!  Yes that previous discussion applies to it, but the database flag for Suspending is 10, so the query should be updated accordingly.


          The list of database flags for a Task Status is...


          A  list of flags defining the state of 'TaskStatus' in the database table 'TaskInstances' is shown below:

          § [TaskStates]

          1 [Waiting for host]
          2 [Starting up]
          3 [In process]
          4 [Retrying]
          5 [Suspended]
          6 [Cancelling]
          7 [OK]
          8 [Cancelled]
          9 [Failed]
          10 [Suspending]
          11 [Resuming]


          So the solution is.....


          If for some reason the cancel operation in the task list is ‘hanging for a certain task, when trying to cancel or suspend it this can be ‘forced to complete by querying the database as follows:


          1. Open the SQL server management studio
            2. Select 'New Query' (make sure the correct database is selected)
            3. Run the following query (see attached screenshots, '‘task_status at 6.jpg’ and '‘task_status updated to 8.jpg’) NOTE: as shown below it is to force a Suspending task to be Suspended.


          UPDATE TaskInstances
          SET TaskStatus = 5
          WHERE TaskStatus = 10