def METHOD_NAME(self, pids):
    tc = rs.job.Container()
    for pid in pids:
        job   = self._jobs[pid]
        pilot = self._pilots[pid]
        # don't overwrite resource_details from the agent
        if 'resource_details' in pilot:
            del pilot['resource_details']
        if pilot['state'] in rps.FINAL:
            continue
        self._log.debug('plan cancellation of %s : %s', pilot, job)
        self._log.debug('request cancel for %s', pilot['uid'])
        tc.add(job)
    self._log.debug('cancellation start')
    tc.cancel()
    tc.wait()
    self._log.debug('cancellation done')