Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-66722

As an JIRA Datacenter Administrator I want to delete stuck global tasks

XMLWordPrintable

    • 15
    • 7
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Problem Definition

      Currently when Jira Datacenter has lost global task (see related JRASERVER-47045, JRASERVER-66204), there is no way to remove this task. All nodes still thinks task is running, so this prevents corresponding operations to be done. 

      Suggested Solution

      Create a plugin and/or health-check which lists running cluster tasks, show possible stuck and allow to remove them.

      Workaround

      Workaround via ScriptRunner in Script Console, From JRASERVER-66204?focusedCommentId=2280767

      1. List all live tasks:
        import com.atlassian.jira.component.ComponentAccessor
        import com.atlassian.jira.task.TaskManagerImpl
         
        def TaskManager = ComponentAccessor.getComponent(TaskManagerImpl)
        def tasks = TaskManager.getLiveTasks()
         
        for(key in tasks){
            log.info 'Taskid: ' + key.getTaskId() + ' Description: ' + key.getDescription() + ' Start Time:' + key.getStartedTimestamp() + ' Username: ' + key.getUserName()
        }
        
      2. Find stuck job and copy <Taskid> number
      3. Kill such Taskid, replacing xxxxxxx with Taskid number
        import com.atlassian.jira.component.ComponentAccessor
        import com.atlassian.jira.task.TaskManagerImpl
         
        def TaskManager = ComponentAccessor.getComponent(TaskManagerImpl)
        TaskManager.removeTask(xxxxxxx)
        

              Unassigned Unassigned
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              19 Vote for this issue
              Watchers:
              26 Start watching this issue

                Created:
                Updated:
                Resolved: