Пример #1
0
    def launch_process(self, u_pid, round, run_type, parameters):
        if run_type != self.CFG.eeagent.launch_type.name:
            raise EEAgentParameterException("Unknown run type %s" % (run_type))

        try:
            factory = self._process_managers_map
            factory.run(make_id(u_pid, round), parameters)
        except Exception, ex:
            self._log.log(logging.ERROR, "Error on launch %s" % (str(ex)))
Пример #2
0
 def _find_proc(self, u_pid, round):
     id = make_id(u_pid, round)
     process = self._process_managers_map.lookup_id(id)
     return process
Пример #3
0
 def _find_proc(self, u_pid, round, ignore_round=False):
     id = make_id(u_pid, round)
     process = self._process_managers_map.lookup_id(id, ignore_round=ignore_round)
     return process
Пример #4
0
                   "%s. Maybe a message never arrived? Leaving process as-is."
                   % (u_pid, state, existing_round, round))
                self._log.warning(msg)
                return

            try:
                process.terminate()
            except PIDanticStateException, pse:
                self._log.warning("Attempt to terminate a process in the state %s" % (str(process.get_state())))
            try:
                process.clean_up()
            except Exception, ex:
                self._log.warning("Failed to cleanup: %s" % (str(ex)))

        factory = self._process_managers_map
        factory.run(make_id(u_pid, round), parameters)

    @eeagent_lock
    def terminate_process(self, u_pid, round):
        process = self._find_proc(u_pid, round)
        if not process:
            return
        try:
            process.terminate()
        except PIDanticStateException, pse:
            self._log.log(logging.WARN, "Attempt to terminate a process in the state %s" % (str(process.get_state())))

    @eeagent_lock
    def restart_process(self, u_pid, round):
        """This is disabled, because there is a tricky issue. Currently, the 
        eeagent does not know how to restart a process with an incremented