Resets the executer scheduler internal state.

        Raises:
            RuntimeError: is the executor is still running.
3071
def reset(self):
        
        if self.running:
            raise RuntimeError('paco: executor is still running')

        self.pool.clear()
        self.observer.clear()
        self.semaphore = asyncio.Semaphore(self.limit, loop=self.loop)
314176
def reset(self):
        
        if self._self_thread is not None:
            # Cancel currently scheduled call
            self._self_thread.cancel()
            self._self_thread = None
        # Schedule a new call
        self._self_thread = hub.spawn_after(self._interval, self)
188865
def run(self):
        ''''''
        logger.info("scheduler starting...")

        while not self._quit:
            try:
                time.sleep(self.LOOP_INTERVAL)
                self.run_once()
                self._exceptions = 0
            except KeyboardInterrupt:
                break
            except Exception as e:
                logger.exception(e)
                self._exceptions += 1
                if self._exceptions > self.EXCEPTION_LIMIT:
                    break
                continue

        logger.info("scheduler exiting...")
        self._dump_cnt()
1153967
async def run(self):
        
        logger.info(__(
            "Starting Resolwe listener on channel '{}'.",
            state.MANAGER_EXECUTOR_CHANNELS.queue
        ))
        while not self._should_stop:
            await self.push_stats()
            ret = await self._call_redis(aioredis.Redis.blpop, state.MANAGER_EXECUTOR_CHANNELS.queue, timeout=1)
            if ret is None:
                self.load_avg.add(0)
                continue
            remaining = await self._call_redis(aioredis.Redis.llen, state.MANAGER_EXECUTOR_CHANNELS.queue)
            self.load_avg.add(remaining + 1)
            self.check_critical_load()
            _, item = ret
            try:
                item = item.decode('utf-8')
                logger.debug(__("Got command from executor: {}", item))
                obj = json.loads(item)
            except json.JSONDecodeError:
                logger.error(
                    __("Undecodable command packet:\n\n{}"),
                    traceback.format_exc()
                )
                continue

            command = obj.get(ExecutorProtocol.COMMAND, None)
            if command is None:
                continue

            service_start = time.perf_counter()

            handler = getattr(self, 'handle_' + command, None)
            if handler:
                try:
                    with PrioritizedBatcher.global_instance():
                        await database_sync_to_async(handler)(obj)
                except Exception:  # pylint: disable=broad-except
                    logger.error(__(
                        "Executor command handling error:\n\n{}",
                        traceback.format_exc()
                    ))
            else:
                logger.error(
                    __("Unknown executor command '{}'.", command),
                    extra={'decoded_packet': obj}
                )

            # We do want to measure wall-clock time elapsed, because
            # system load will impact event handling performance. On
            # a lagging system, good internal performance is meaningless.
            service_end = time.perf_counter()
            self.service_time.update(service_end - service_start)
        logger.info(__(
            "Stopping Resolwe listener on channel '{}'.",
            state.MANAGER_EXECUTOR_CHANNELS.queue
        ))
798453
def reset(self):
        
        self._stack = []
        self._callbacks = []
        pipes = self._pipelines
        self._pipelines = {}
        for pipe in pipes.values():
            pipe.reset()
336381
public static void setExecutor(Executor executor) {
        Validate.notNull(executor, "executor");
        synchronized (LOCK) {
            Settings.executor = executor;
        }
    }
358319
@Override
    public void run() {
        final ScheduledFuture<?> future = this.executor.scheduleWithFixedDelay(this.scheduled, 0, this.delayMillis,
                TimeUnit.MILLISECONDS);
        try {
            this.runTrigger.await();
        } catch (final InterruptedException e) {
            this.listener.handle(e);
        } finally {
            future.cancel(true); // stop the periodic reading
            this.scheduled.cleanup();
            this.executor.shutdownNow();
            this.listener.destroy();
        }
    }
471654
def _reset(cls):
        """"""
        if os.getpid() != cls._cls_pid:
            cls._cls_pid = os.getpid()
            cls._cls_instances_by_target.clear()
            cls._cls_thread_by_target.clear()
993677
private void scheduleRetryFuture() {
        Log.v(Log.TAG_SYNC, "%s: Failed to xfer; will retry in %d sec", this, RETRY_DELAY_SECONDS);
        synchronized (executor) {
            if (!executor.isShutdown()) {
                this.retryFuture = executor.schedule(new Runnable() {
                    public void run() {
                        retryIfReady();
                    }
                }, RETRY_DELAY_SECONDS, TimeUnit.SECONDS);
            }
        }
    }
1348325
def reset(self):
        
        if self._call_later_handler is not None:
            self._call_later_handler.cancel()
            self._call_later_handler = None
            self._wait_done_cb()
584926
def reset():
    
    if hasattr(ray.worker.global_worker, "signal_counters"):
        ray.worker.global_worker.signal_counters = defaultdict(lambda: b"0")
908753
def reset_state(self):
        
        assert not self._reset_done, "reset_state() was called twice! This violates the API of DataFlow!"
        self._reset_done = True

        # __del__ not guaranteed to get called at exit
        atexit.register(del_weakref, weakref.ref(self))
521519
def set_executor(self, executor: futures.Executor):
        
        self.loop.set_default_executor(executor)
        self._func_executor = executor
        return True
1110491
def run(self, scheduler_schedule_id, **kwargs):
        
        log = self.get_logger(**kwargs)

        self.scheduler.update_schedule(scheduler_schedule_id, {"active": False})
        log.info(
            "Deactivated schedule %s in the scheduler service", scheduler_schedule_id
        )
307654
def reset(self, keep_state=False):
        
        if not keep_state:
            self.state = state.ManagerState(state.MANAGER_STATE_PREFIX)
            self.state.reset()
        async_to_sync(consumer.run_consumer)(timeout=1)
        async_to_sync(self.sync_counter.reset)()
863203
def reset(self):
        
        self._start_time = None
        self._end_time = None
        self._elapsed_time = datetime.timedelta()
        self._cumulative_elapsed_time = datetime.timedelta()
        self.split_elapsed_time = []
1216220
def _execute(self) -> None:
        '''

        '''

        if hasattr(self, '_last_resolver_exception'):
            logger.warning('last exception from %s.%s:', self.__class__.__name__, self._last_resolver_exception[0], exc_info = self._last_resolver_exception[1])

        self.setup()
        self.run()
        self.check()