Terminate all resources from a worker type

        Terminate all instances for this worker type

        This method is ``experimental``
334425
def terminateWorkerType(self, *args, **kwargs):
        

        return self._makeApiCall(self.funcinfo["terminateWorkerType"], *args, **kwargs)
953236
def kill_all():
    """"""
    for i in dispatchers.all_instances():
        try:
            os.kill(-i.pid, signal.SIGKILL)
        except OSError:
            # The process was already dead, no problem
            pass
1180406
def terminate(self, container):
        
        self._client_chk.check(container)
        args = {
            'container': int(container),
        }
        response = self._client.raw('corex.terminate', args)

        result = response.get()
        if result.state != 'SUCCESS':
            raise RuntimeError('failed to terminate container: %s' % result.data)
1281438
def stop_workers(self, clean):
        """"""
        with executor_lock:
            self.executor.shutdown(clean)
            del self.executor
        with self.worker_lock:
            if clean:
                self.pool.close()
            else:
                self.pool.terminate()
            self.pool.join()
            del self.pool
            for x in self.events.values():
                x.event.cancel()
            self.events.clear()
177117
def terminate_instances(self, instance_ids=None):
        
        params = {}
        if instance_ids:
            self.build_list_params(params, instance_ids, 'InstanceId')
        return self.get_list('TerminateInstances', params,
                             [('item', Instance)], verb='POST')
1091676
def stop(self):
        

        instance_status = Instance.InstanceStatus(status='Terminated')
        xml_content = instance_status.serialize()

        headers = {'Content-Type': 'application/xml'}
        self._client.put(self.resource(), xml_content, headers=headers)
1086911
def close(self):
        """"""
        # Ensure everything is cleaned up on exit
        scoop.logger.debug('Closing workers on {0}.'.format(self))

        # Terminate subprocesses
        for process in self.subprocesses:
            try:
                process.terminate()
            except OSError:
                pass
1327028
function closeAllWorkers() {
        Object.keys(cluster.workers).forEach(id => {

            // Get a handle on the worker process
            const worker = cluster.workers[id];

            // Check this worker isn't already done
            if (worker.state === "disconnected") {
                return;
            }

            // Tell the worker to shutdown
            worker.send("pluribus-shutdown");
            worker.disconnect();

            // If the worker is too slow, shut it down anyway
            const timeout = setTimeout(_ => {
                logger("Forcing", worker.process.pid, "to shutdown");
                worker.kill("SIGKILL");
            }, options.waitTimeout);

            // If the worker shuts down okay, cancel the forced shutdown
            worker.on("exit", function () {
                logger("Worker", worker.process.pid, "exited");
                clearTimeout(timeout);
            });
        });
    }
109649
def worker_stop(obj, worker_ids):
    
    if len(worker_ids) == 0:
        msg = 'Would you like to stop all workers?'
    else:
        msg = '\n{}\n\n{}'.format('\n'.join(worker_ids),
                                  'Would you like to stop these workers?')

    if click.confirm(msg, default=True, abort=True):
        stop_worker(obj['config'],
                    worker_ids=list(worker_ids) if len(worker_ids) > 0 else None)
79757
def stop_all(self):
        
        logger.info('Shutting down modules...')
        # Ask internal to quit if they can
        for instance in self.get_internal_instances():
            if hasattr(instance, 'quit') and isinstance(instance.quit, collections.Callable):
                instance.quit()

        self.clear_instances([instance for instance in self.instances if instance.is_external])
1205798
def Terminate(self):
		
		
		self.lock.acquire()
		try:
			for bucket in self.connections.values():
				try:
					for conn in bucket:
						conn.lock()
						try:
							conn.Close()
						except Exception:
							#We may throw exceptions due to already closed connections
							pass
						conn.release()
				except Exception:
					pass
			self.connections = {}
		finally:
			self.lock.release()
821295
def terminate_all(self):
        """"""
        for worker in self._workers:
            worker.terminate()

        # for thread in self._threads:
        #     try:
        #         thread.terminate()
        #         thread.wait()
        #     except Exception:
        #         pass
        self._queue_workers = deque()
620904
def kill_all(self):
        ''''''
        while self._num_workers > 0 and self._worker_backend_socket.poll(1000):
            msg = self._worker_backend_socket.recv_pyobj()
            self._worker_backend_socket.send_pyobj(None)
            self._num_workers -= 1
            self.report(f'Kill {msg[1:]}')
        # join all processes
        [worker.join() for worker in self._workers]
141054
def terminate(self, devices):
        
        for device in devices:
            self.logger.info('Terminating: %s', device.id)
            try:
                device.delete()
            except packet.baseapi.Error:
                raise PacketManagerException('Unable to terminate instance "{}"'.format(device.id))
1004253
def close(self, **kwargs):
        
        self.scale_down(self.cluster.scheduler.workers)
        return self.cluster.close(**kwargs)
954533
def stop(self):
        '''
        
        '''
        assert(self.model)
        assert(self.user_interface)
        assert(self.target)
        self.user_interface.stop()
        self.target.teardown()
        self.dataman.submit_task(None)
        self._un_set_signal_handler()
809655
def exit_actor():
    
    worker = ray.worker.global_worker
    if worker.mode == ray.WORKER_MODE and not worker.actor_id.is_nil():
        # Disconnect the worker from the raylet. The point of
        # this is so that when the worker kills itself below, the
        # raylet won't push an error message to the driver.
        worker.raylet_client.disconnect()
        ray.disconnect()
        # Disconnect global state from GCS.
        ray.global_state.disconnect()
        sys.exit(0)
        assert False, "This process should have terminated."
    else:
        raise Exception("exit_actor called on a non-actor worker.")