Skip to content

Commit

Permalink
- Make processbot more resilient to errors
Browse files Browse the repository at this point in the history
  • Loading branch information
geosolutions committed Jun 28, 2017
1 parent 7879f74 commit f9d3b57
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/wpsremote/processbot.py
Expand Up @@ -148,23 +148,23 @@ def run(self):
self.bus.Listen()

def SpawnProcess(self):
logger = logging.getLogger("ProcessBot.SpawnProcess")
self.ensure_output_dir_exists()
try:
logger = logging.getLogger("ProcessBot.SpawnProcess")
self.ensure_output_dir_exists()

#set the actual value of input parameters to input parameters definitions
self._input_parameters_defs.set_values( self._input_values )
#set the actual value of input parameters to input parameters definitions
self._input_parameters_defs.set_values( self._input_values )

#execute actions associated to input parameters
self._input_params_actions.execute( self._input_parameters_defs )
#execute actions associated to input parameters
self._input_params_actions.execute( self._input_parameters_defs )

#prepare cmd line
cmd = self._executable_cmd + " " + self._input_params_actions.get_cmd_line()
#prepare cmd line
cmd = self._executable_cmd + " " + self._input_params_actions.get_cmd_line()

#spawn the computational job process
invoked_process = subprocess.Popen(args=cmd.split(), cwd=self._executable_path, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False)
logger.info("process " + self.service + " created with PId " + str(invoked_process.pid) + " and command line: " + cmd)
#spawn the computational job process
invoked_process = subprocess.Popen(args=cmd.split(), cwd=self._executable_path, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=False)
logger.info("process " + self.service + " created with PId " + str(invoked_process.pid) + " and command line: " + cmd)

try:
#read the resource file
rc = resource_cleaner.Resource.create_from_file(self._uniqueExeId, os.getpid())
#add the pid of the computational job to the resource file
Expand Down

0 comments on commit f9d3b57

Please sign in to comment.