예제 #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
파일: core.py 프로젝트: ooici/eeagent
 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
파일: core.py 프로젝트: ooici/eeagent
                   "%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