Skip to content

Commit f9d3b57

Browse files
author
geosolutions
committed
- Make processbot more resilient to errors
1 parent 7879f74 commit f9d3b57

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/wpsremote/processbot.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -148,23 +148,23 @@ def run(self):
148148
self.bus.Listen()
149149

150150
def SpawnProcess(self):
151-
logger = logging.getLogger("ProcessBot.SpawnProcess")
152-
self.ensure_output_dir_exists()
151+
try:
152+
logger = logging.getLogger("ProcessBot.SpawnProcess")
153+
self.ensure_output_dir_exists()
153154

154-
#set the actual value of input parameters to input parameters definitions
155-
self._input_parameters_defs.set_values( self._input_values )
155+
#set the actual value of input parameters to input parameters definitions
156+
self._input_parameters_defs.set_values( self._input_values )
156157

157-
#execute actions associated to input parameters
158-
self._input_params_actions.execute( self._input_parameters_defs )
158+
#execute actions associated to input parameters
159+
self._input_params_actions.execute( self._input_parameters_defs )
159160

160-
#prepare cmd line
161-
cmd = self._executable_cmd + " " + self._input_params_actions.get_cmd_line()
161+
#prepare cmd line
162+
cmd = self._executable_cmd + " " + self._input_params_actions.get_cmd_line()
162163

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

167-
try:
168168
#read the resource file
169169
rc = resource_cleaner.Resource.create_from_file(self._uniqueExeId, os.getpid())
170170
#add the pid of the computational job to the resource file

0 commit comments

Comments
 (0)