in tensorflow/inference/docker/build_artifacts/sagemaker_neuron/serve.py [0:0]
def _monitor(self):
while True:
pid, status = os.wait()
if self._state != "started":
break
if pid == self._nginx.pid:
log.warning("unexpected nginx exit (status: {}). restarting.".format(status))
self._start_nginx()
elif self._is_tfs_process(pid):
log.warning(
"unexpected tensorflow serving exit (status: {}). restarting.".format(status)
)
try:
self._restart_single_tfs(pid)
except (ValueError, OSError) as error:
log.error("Failed to restart tensorflow serving. {}".format(error))
elif self._gunicorn and pid == self._gunicorn.pid:
log.warning("unexpected gunicorn exit (status: {}). restarting.".format(status))
self._start_gunicorn()