Checks for a few things before deciding to delete the parent stack

   * Parent stack status status is ROLLBACK_COMPLETE
   * Parent resources are in the DELETE_COMPLETE state
172820
def minimal_rollback_complete?
      stack = find_stack(stack_name)
      return false unless stack

      return false unless stack.stack_status == 'ROLLBACK_COMPLETE'

      # Finally check if all the minimal resources in the parent template have been deleted
      resp = cfn.describe_stack_resources(stack_name: stack_name)
      resource_statuses = resp.stack_resources.map(&:resource_status).uniq
      resource_statuses == ['DELETE_COMPLETE']
    end
1232861
public function cleanupCollapsedStatesInUC()
    {
        $backendUser = $this->getBackendUser();
        if (is_array($backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'])) {
            $collapsedGridelementColumns = $backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'];
            foreach ($collapsedGridelementColumns as $item => $collapsed) {
                if (empty($collapsed)) {
                    unset($collapsedGridelementColumns[$item]);
                }
            }
            $backendUser->uc['moduleData']['page']['gridelementsCollapsedColumns'] = $collapsedGridelementColumns;
            $backendUser->writeUC($backendUser->uc);
        }
    }
756855
public void complete() {
    // we have to traverse up to our parent, so be careful about locking.
    Progress myParent;
    synchronized(this) {
      progress = 1.0f;
      myParent = parent;
    }
    if (myParent != null) {
      // this will synchronize on the parent, so we make sure we release
      // our lock before getting the parent's, since we're traversing 
      // against the normal traversal direction used by get() or toString().
      // We don't need transactional semantics, so we're OK doing this. 
      myParent.startNextPhase();
    }
  }
552621
def handle_stack_error(e)
      case e.message
      when /is in ROLLBACK_COMPLETE state and can not be updated/
        puts "The #{@stack_name} stack is in #{"ROLLBACK_COMPLETE".color(:red)} and cannot be updated. Deleted the stack and try again."
        region = `aws configure get region`.strip rescue 'us-east-1'
        url = "https://console.aws.amazon.com/cloudformation/home?region=#{region}"
        puts "Here's the CloudFormation console url: #{url}"
        exit 1
      when /No updates are to be performed/
        puts "There are no updates to be performed. Exiting.".color(:yellow)
        exit 1
      else
        raise
      end
    end
65610
def cleanup(self):
        
        if self.sock is not None:
            self.sock.close()
        if self.outfile is not None:
            self.outfile.close()
        if self.bar is not None:
            self.update_progress(complete=True)
797544
def check_children(self):
        '''
        
        '''
        if self._restart_processes is True:
            for pid, mapping in six.iteritems(self._process_map):
                if not mapping['Process'].is_alive():
                    log.trace('Process restart of %s', pid)
                    self.restart_process(pid)
1307238
def _fallback_cleanups(self):
        '''
        
        '''
        # Add an extra fallback in case a forked process leaks through
        multiprocessing.active_children()

        # Cleanup Windows threads
        if not salt.utils.platform.is_windows():
            return
        for thread in self.win_proc:
            if not thread.is_alive():
                thread.join()
                try:
                    self.win_proc.remove(thread)
                    del thread
                except (ValueError, NameError):
                    pass
896019
def destroy
      parent = curation_concern.parent
      actor.destroy
      redirect_to [main_app, parent], notice: 'The file has been deleted.'
    end
1140955
final void cleanStack() {
    boolean unlinked = false;
    Completion p;
    while ((p = stack) != null && !p.isLive()) // ensure head of stack live
      unlinked = casStack(p, p.next);
    if (p != null && !unlinked) { // try to unlink first nonlive
      for (Completion q = p.next; q != null;) {
        Completion s = q.next;
        if (q.isLive()) {
          p = q;
          q = s;
        } else {
          casNext(p, q, s);
          break;
        }
      }
    }
  }
335235
def check_for_deletion(self, relative_path=None):
        
        if not relative_path:
            relative_path = str()  # root of shared directory tree

        remote_path = path_join(self.remote_path, relative_path)
        local_path = path_join(self.local_path, relative_path)

        for remote_st in self.sftp.listdir_attr(remote_path):
            r_lstat = self.sftp.lstat(path_join(remote_path, remote_st.filename))

            inner_remote_path = path_join(remote_path, remote_st.filename)
            inner_local_path = path_join(local_path, remote_st.filename)

            # check if remote_st is a symlink
            # otherwise could delete file outside shared directory
            if S_ISLNK(r_lstat.st_mode):
                if self._must_be_deleted(inner_local_path, r_lstat):
                    self.remote_delete(inner_remote_path, r_lstat)
                continue

            if self._must_be_deleted(inner_local_path, remote_st):
                self.remote_delete(inner_remote_path, remote_st)
            elif S_ISDIR(remote_st.st_mode):
                self.check_for_deletion(
                    path_join(relative_path, remote_st.filename)
                )
477368
async def rollback(self):
        """"""
        if not self._parent._is_active:
            return
        await self._do_rollback()
        self._is_active = False
1253712
private void performRefreshComplete() {
        mStatus = PTR_STATUS_COMPLETE;

        // if is auto refresh do nothing, wait scroller stop
        if (mScrollChecker.mIsRunning && isAutoRefresh()) {
            // do nothing
            if (DEBUG) {
                PtrCLog.d(LOG_TAG, "performRefreshComplete do nothing, scrolling: %s, auto refresh: %s",
                        mScrollChecker.mIsRunning, mFlag);
            }
            return;
        }

        notifyUIRefreshComplete(false);
    }
868893
void rollbackResources()
    {
        final boolean traceOn = TraceComponent.isAnyTracingEnabled();

        if (traceOn && tc.isEntryEnabled())
            Tr.entry(tc, "rollbackResources", this);

        distributeEnd(XAResource.TMFAIL);
        _outcome = false;
        _retryRequired = distributeOutcome();

        if (traceOn && tc.isEntryEnabled())
            Tr.exit(tc, "rollbackResources", _retryRequired);
    }
237372
private boolean isRollbackOnlyAllowed() {
        switch (state) {
            case PRE_CREATE:
            case AFTER_COMPLETION:
                return false;

            case CREATING:
                return isLifecycleCallbackGlobalTx(LifecycleInterceptorWrapper.MID_POST_CONSTRUCT);

            case ACTIVATING:
                return isLifecycleCallbackGlobalTx(LifecycleInterceptorWrapper.MID_PRE_PASSIVATE);

            case PASSIVATING:
                return isLifecycleCallbackGlobalTx(LifecycleInterceptorWrapper.MID_PRE_PASSIVATE);

            case REMOVING:
                return isLifecycleCallbackGlobalTx(LifecycleInterceptorWrapper.MID_PRE_DESTROY);

            case DESTROYED:
                return destroying && isLifecycleCallbackGlobalTx(LifecycleInterceptorWrapper.MID_PRE_DESTROY);
        }

        return true;
    }
1223674
def remove_from_parent(self):
        '''
        
        '''
        if self.parent:
            self.parent._children.remove(self)
            self.parent._invalidate_time_caches()
            self.parent = None
1159124
def perform(stack)
      Shipit::ApiClient.where(stack_id: stack.id).delete_all
      commits_ids = Shipit::Commit.where(stack_id: stack.id).pluck(:id)
      commit_deployments_ids = Shipit::CommitDeployment.where(commit_id: commits_ids).pluck(:id)
      Shipit::CommitDeploymentStatus.where(commit_deployment_id: commit_deployments_ids).delete_all
      Shipit::CommitDeployment.where(id: commit_deployments_ids).delete_all
      Shipit::Status.where(commit_id: commits_ids).delete_all
      Shipit::Commit.where(id: commits_ids).delete_all
      Shipit::GithubHook.where(stack_id: stack.id).destroy_all
      Shipit::Hook.where(stack_id: stack.id).delete_all
      Shipit::PullRequest.where(stack_id: stack.id).delete_all
      tasks_ids = Shipit::Task.where(stack_id: stack.id).pluck(:id)
      tasks_ids.each_slice(100) do |ids|
        Shipit::OutputChunk.where(task_id: ids).delete_all
        Shipit::Task.where(id: ids).delete_all
      end
      stack.destroy!
    end
126382
@Override
    public void rollback() throws IllegalStateException, SystemException
    {
        for (ResourceManager implementor : implementors)
        {
            if (implementor != null)
            {
                implementor.doRollback();
                status = Status.STATUS_ROLLEDBACK;
            }
        }
    }