@@ -200,8 +200,6 @@ def _process_deployment_info(self):
200200 else :
201201 self ._management_endpoints = json .loads (self ._management_endpoints )
202202
203-
204-
205203 if not has_error :
206204 self ._logger .info ("External endpoint: %s" , self ._external_endpoint )
207205 self ._logger .info ("Internal endpoint: %s" , self ._internal_endpoint )
@@ -224,30 +222,30 @@ def sigterm(self, signum, _):
224222 raise KeyboardInterrupt
225223
226224 def sigchld (self , signum , _ ):
227- should_shutdown , pid , failed_process_name , log_filepath = self ._deployment .check_child_process ()
225+ if self ._shutting_down :
226+ return
227+
228+ should_shutdown , pid , stopped_process_name , log_filepath = self ._deployment .check_child_process ()
228229
229230 if should_shutdown :
230- self ._update_deployment_status (True , "A sandbox process stopped unexpectedly: " + failed_process_name , log_filepath )
231+ self ._update_deployment_status (True , "A sandbox process stopped unexpectedly: " + stopped_process_name , log_filepath )
231232
232233 if pid == self ._queue_service_process .pid :
233234 self ._queue_service_process = None
234235 elif pid == self ._frontend_process .pid :
235236 self ._frontend_process = None
236- elif failed_process_name == "Fluent-bit" :
237+ elif stopped_process_name == "Fluent-bit" :
237238 self ._fluentbit_process = None
238239
239- self .shutdown (reason = "Process " + failed_process_name + " with pid: " + str (pid ) + " stopped unexpectedly." )
240+ self .shutdown (reason = "Process " + stopped_process_name + " with pid: " + str (pid ) + " stopped unexpectedly." )
240241
241242 def shutdown (self , reason = None ):
242- if self ._shutting_down :
243- return
244-
245243 self ._shutting_down = True
246244 errmsg = ""
247245 if reason is not None :
248246 errmsg = "Shutting down sandboxagent due to reason: " + reason + "..."
249247 self ._logger .info (errmsg )
250- # some process dies unexpectedly; need to stop as immediately as possible
248+ # some process died unexpectedly; need to stop as immediately as possible
251249 if self ._fluentbit_process is not None :
252250 time .sleep (2 ) # flush interval of fluent-bit
253251 os ._exit (1 )
@@ -269,8 +267,8 @@ def shutdown(self, reason=None):
269267 self ._local_queue_client .removeTopic (self ._instructions_topic )
270268 self ._local_queue_client .shutdown ()
271269
272- self ._logger .info ("Shutting down the queue service..." )
273- process_utils .terminate_and_wait_child (self ._queue_service_process , "queue service" , 5 , self ._logger )
270+ # self._logger.info("Shutting down the queue service...")
271+ # process_utils.terminate_and_wait_child(self._queue_service_process, "queue service", 5, self._logger)
274272 else :
275273 self ._logger .info ("No queue service; most probably it was the reason of the shutdown." )
276274 self ._logger .info ("Force shutting down the function worker(s)..." )
0 commit comments